Jump to content
The Uniform Server Community
Sign in to follow this  
lateStudent

PHP Session Timeouts

Recommended Posts

Hi everyone :)

 

I am currently a student in a web programming course and we are using Uniserver for our classwork and assignments where we use PHP.

 

I am trying to find a way to prgrammatically change the timeout setting for PHP session variables from the default value in the php.ini file (1440 secs).

 

Using ini_set('session.gc_maxlifetime', 100); (both before and after session_start()) seems to change the timeout value as displayed using: echo ini_get('session.gc_maxlifetime'), but if I then reload the php page well after100 secs without closing the browser, all the session variables are still there with their previous values.

 

I then manually changed the time out setting in the php.ini file to:

 

session.gc_maxlifetime = 100

 

But it now appears that the default timeout value is not got from this setting in the php.ini file because

echo ini_get('session.gc_maxlifetime') still displayed 1440 when I called the php file.

 

Please help...!!!!

 

Where does Uniserver/PHP get its default sessions timeout value from and how can I change it to another value programatically in a php script?

 

Any help much appreciated,

 

lateStudent..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...