yyboo Posted August 23, 2006 Share Posted August 23, 2006 Hi,I have a PHP session problem. I need my users to be able to have their session last 2 or 3 hours, but all sessions get trashed at 20-24 minutes.I read up on php.net/sessions and one guy there posted a nice 3 point topic on how to get a longer session.. So I followed his advice. One of the things I was supposed to do, and I did, was that I asked my server to give me a specific folder that I could store my session in, and they gave me /tmp.... which I thought was the default and therefore not really a help, since the guy on php.net said the default folder is /tmp and other people's gc could end your session.. But not understanding the structure of a server much , I thought perhaps this /tmp was perhaps in the realm of my own site/folder on the server so maybe it was mine alone.. don't know..Before I ask my server to make yet another folder for me to test and see if that is the problem, I thought I would post a screenshot of the session part of my phpinfo. If anyone has any input I would really appreciate it! I have users screaming at me because they are getting bumped off my site at about 20 min. and they need longer to fill out my forms - they need a few hours, it's a several-page study they are filling out for a counseling session....see attached imageThanks in advance for your help! [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/18488-php-need-a-long-session-and-cant-seem-to-get-one/ Share on other sites More sharing options...
AndyB Posted August 23, 2006 Share Posted August 23, 2006 Read the scriptlet posted by info at ericbontenbal dot nl at http://ca.php.net/manual/en/function.session-cache-expire.php - that looks as though it will do what you want. Link to comment https://forums.phpfreaks.com/topic/18488-php-need-a-long-session-and-cant-seem-to-get-one/#findComment-79627 Share on other sites More sharing options...
yyboo Posted August 23, 2006 Author Share Posted August 23, 2006 As you can see from my screenshot attached above, I already have that set for 10800 which = 3 hours. But still I timeout at about 24 minutes. So I am still looking for helpful suggestions from php pros here... thanks! Link to comment https://forums.phpfreaks.com/topic/18488-php-need-a-long-session-and-cant-seem-to-get-one/#findComment-79629 Share on other sites More sharing options...
michaellunsford Posted August 24, 2006 Share Posted August 24, 2006 when does your PHPSESSID cookie expire? Link to comment https://forums.phpfreaks.com/topic/18488-php-need-a-long-session-and-cant-seem-to-get-one/#findComment-79985 Share on other sites More sharing options...
yyboo Posted August 24, 2006 Author Share Posted August 24, 2006 I haveini_set("session.cookie_lifetime","36000");right now and it did no good...That may not be reflected in the screenshot above.. Link to comment https://forums.phpfreaks.com/topic/18488-php-need-a-long-session-and-cant-seem-to-get-one/#findComment-80078 Share on other sites More sharing options...
michaellunsford Posted August 24, 2006 Share Posted August 24, 2006 Generally, the session directory is NOT /tmp. I don't know how long /tmp keeps stuff, but I do know the server occasionally sweeps that directory. And that just might be your problem.A server I just checked keeps their sessions in the /var/lib/php/session directory. We've had a few problems, though. One server wouldn't write to the directory with the correct permissions of 700, so we had to make it 777. Link to comment https://forums.phpfreaks.com/topic/18488-php-need-a-long-session-and-cant-seem-to-get-one/#findComment-80090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.