Session Timeout

I have a customer using a PHP script that basically uses sessions. Now after x minutes if idleness if the user tries to do something it shows that the session timed out and redirects them to a login screen.

He needs to increase the timeout to at least 3 times longer. He doesn't want to alter the script so I think he can do it in a custom php.ini.

I have never done this and have no idea what is involved.

- Where do you place the php.ini?
- What goes in there? Just the items needed to override some defaults or does everything need to be replicated in there.

Any help would be greately appreciated.

Thanks
 
Was just waiting for unix admin to pick it up, as I don't have the answer for you :)
 
Stephen said:
Was just waiting for unix admin to pick it up, as I don't have the answer for you :)

No problem... hopefully someone will speak up soon. I need to give some answers to my client, but I don't want to lead him wrong or cause any problems with other scripts.

Thanks
 
More specific quesetions for the Unix folks out there...

1) If I have a custom PHP.INI. If it is placed in the root of the website do only the scripts in the root use it? Do the scripts that are in subfolders use the custom PHP.INI sitting in the root as well?

2) I believe the directive I need to override is session.cache_expire. Do I JUST put that one entry in the PHP.INI or do I have to put everything in there? I basically want all the defaults from the standard PHP.INI to be in effect, but JUST override that one directive.

Thanks
 
just upload a .htaccess at doman root, with your custom options in below format:
php_value session.auto_start 0
 
tanmaya said:
just upload a .htaccess at doman root, with your custom options in below format:
php_value session.auto_start 0

1) Oh... so I don't use a php.ini file?

2) I was told by the developer of the script to use the session.cache_expire directive. Is that not correct? Should I use the directive you have listed above? Remember I have never messed with this before so it is all a little greek.

Thanks
 
1. That is for Windows
2. Sorry, that was just an example.
For you it will be like:
php_value session.cache_expire "180"
 
Also this is what documentation says about session.auto_start:

<< session.auto_start specifies whether the session module starts a session automatically on request startup. Defaults to 0 (disabled). >>

So that doesn't look like it has anything to do with how long a session is allowed before timing out.

Just trying to understand this and get to a final answer.
 
tanmaya said:
1. That is for Windows
2. Sorry, that was just an example.
For you it will be like:
php_value session.cache_expire "180"

Once I make this change does the apache server have to be restared? Someone mentioned it may not take effect immediately without a restart or something.
 
Back
Top