RE: [PHP] Making a Session Longer

From: Date: Tue, 30 Sep 2003 20:42:18 +0000
Subject: RE: [PHP] Making a Session Longer
Groups: php.general 
Request: Send a blank email to php-general+get-164450@lists.php.net to get a copy of this message
Free, I am assuming you are using PHP sessions. If you are storing sessions using the your own save handler routines (this is quite common when saving session in the MySQL database), you have the ability to establish your own session timeout and "Garbage Cleanup" routines. This means you can cause the session timeout for your application to be different from other applications on the same server, provided you are storing your sessions in a different place than other applications (your own session table or directory). see session_set_save_handler(); in the manual Not sure about the shortening time limits, perhaps the current garbage cleanup routine has a bug. This is easy to do if your session table is in MySQL, since the database "timestamp" data type is not the same as a "date/time" data type. The date/time is returned as a string formatted "YYYY-mm-dd hh:mm:ss" and the time stamp is returned as a string "YYYYmmddhhmmss". I would look for a bug in the session_read or the session_gc routines. You know it just occurred to me, that if you are using files in the /tmp directory for storing sessions, all you need is one application with a bad "Garbage Collection" routine on this same server and using the /tmp directory, to affect all applications with just the symptoms you are seeing. good luck, Warren Vail -----Original Message----- From: Free Grafton [mailto:free@churchcommunitybuilder.com] Sent: Tuesday, September 30, 2003 12:14 PM To: php-general@lists.php.net Subject: [PHP] Making a Session Longer We offer an application for our customers which allows them to log into their organization and participate in discussions, register for events and build their websites. We are using Apache 2.0.47, PHP 4.3.3 and MySQL 4.0.15 for the application. We use session cookies with PHP to establish their permissions and store other information about them while they are logged in. The problem we are experiencing is that we are starting to have so many users on at one time that they are getting bumped off faster and faster. We have increased the MaxUsers in apache up to 1000, but that doesn¹t seem to make any difference. Our session_cookie is set to 0 in the php.ini file so there is no inherent timeout for users. We have 1.5GB of memory on our production server and aren¹t experiencing any memory swaps, so I don¹t think that is it as well. The only other possible thing I can think is that it might be related to session.gc_maxlifetime =1440 in the php.ini file. I have looked and can¹t really find much valuable information on what this really does and if it would have any affect on our sites. So, if anyone has some advise on what we can try, it sure would be greatly appreciated. Have an excellent day! Free Grafton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#164450) next »