PHP sessions problem

Status
Not open for further replies.

user987

New Member
Messages
10
Reaction score
0
Points
0
Since the servers migration, I've been noticing an intermittent problem regarding PHP sessions. Once in a while, a session assigned to a user who's just logged in is randomly erased or stops being recognized, which forces the user to log in again.

I've come across a few threads relating to this issue and it seems like it has something to do with the load balanced setup.

I'd be pleased if you looked into this issue as my website completely relies on sessions to work.
 
Last edited:

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
PHP sessions are actually made to be temporary (i.e. For a 'session'), hence why they are stored in the '/tmp' folder on the server. If you are looking for a more permanent way of maintaining state between such sessions you should use a cookie in conjunction with the session, this allows you to identify users as cookies are designed for persistent data that can be set to expire months or years in the future.
 

user987

New Member
Messages
10
Reaction score
0
Points
0
I understand that, but sometimes sessions are erased within minutes or seconds from the time they were created. For example, right after logging in, some users are taken back to the login page because the session no longer exists or is not "seen" by the script. In some cases, refreshing the page causes the script to recognize session data properly. Also, it doesn't happen with every started session. Most of the times, everything works as expected.
 
Status
Not open for further replies.
Top