I am having a problem with a pge where users can write comments.
Some users can write REALLY long one and this can take them up to 30mn.
The problem is that when they are trying to validate their post, all session is lost due to browser inactivity (user stayed on same page).
Does anybody have a good solution for this?
thx
s
Keeping session data alive
Moderator: General Moderators
The simplest solution would be to extend the session lifetime by configuring session.gc_maxlifetime (either in php.ini or using ini_set()).
The more robust, but less secure solution is to serialize the SESSION array and put it in a hidden form field, then when the form is posted restore it if there is no valid session. I say less secure, because it puts all your session variables out there in the open.
The more robust, but less secure solution is to serialize the SESSION array and put it in a hidden form field, then when the form is posted restore it if there is no valid session. I say less secure, because it puts all your session variables out there in the open.