I am using Session::set_flash for my 'Status' class, which shows validation messages if there are any. Now I found this: If I set and get the flash session variable on the same page, then the it will be available on the next page as well. For example: user tries to login, mistypes the password, (submit), validation fails, and the page continues loading, and shows the login form again. (Actually I should say request instead of page). The set and the get are in the same request.
I also have to say, that my status class can contain more then one message, and they are stored in an array. So every time I set the flash variable, I actually get it, push the new element in the array and set it again. Maybe it is not the best way, I am thinking of rewriting it, but now I would like to solve this problem.
Actually I do not get an Exception. The flash message keeps displaying for one more request. But it is only a problem, when I want to use its value on the same page I set the value.
Session data is processed in the shutdown event, and the end of the request, and after output has been send to the client.
When you set a flash variable, it is in a 'new' state. It is marked as old when the session loads, and removed while processing the data when the state is 'old'.
This means flash variables never expire within the same request, whether or not you have used them.
Yes, that was a bug in 1.3 and corrected (but appearently you want the old behavior).
The bug is present in every PHP version, if you get an exception in the exception handler then PHP can not handle it, and gives a "error without a stack-frame in line 0" error..