being kicked out from session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

being kicked out from session

Post by m2babaey »

Hi
I have used session to create a login script. it works fine on localhost, but when I upload it to server, if you don't have activity for a few seconds (about 5 sec), you are kicked out from session
I tried to view phpinfo to check maxlifetime, but the host manager has disabled this function although they claimed maxlifetime has the default value (i think 1440)
also they have restricted the configurations so that I cannot have my own php.ini

How do you think I can fix the problem?
Thanks in advance
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Re: being kicked out from session

Post by m2babaey »

problem solved by adding

Code: Select all

 ini_set('session.gc_maxlifetime', 60*30);
before session_start()
but do you know how I can view session.gc_maxlifetime when phpinfo is disabled?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: being kicked out from session

Post by requinix »

ini_get

If sessions are that broken then it's a problem your host needs to fix.
Post Reply