TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   increasing session time (http://www.talkphp.com/general/4999-increasing-session-time.html)

pipesportugal 10-05-2009 01:08 PM

increasing session time
 
Hello dear colleagues from the TalkPHP forum,

Sometime ago the admin of my server has decreased the session time and now when I am using our reserved area the session extinguishes very fast.

Can please someone tell me how from inside my php program can I increase this time ?

Regards and thanks in advance,

afraca 10-05-2009 01:27 PM

What do you mean with "from inside my php program" ? If you have direct access to the php config directory you should edit the php.ini file, look for the part with "session.gc_maxlifetime" and set it to how many seconds you want.

However, if I'm right, you're restricted, so you could do it in php with the ini_set function. use this:

PHP Code:

<?php
ini_set
(session.gc_maxlifetime28800);
// Set maxlifetime to 4 hours, overwriting php.ini’s value
?>

(session.gc_maxlifetime should have single quotes, but the forum is converting them...... (new at forum, howto fix that?)

pipesportugal 10-05-2009 01:58 PM

Hi,

In fact I do not have access to the php.ini file.

I should use the ini_set instruction just before the session_start(), right ?

Thanks in advance,
pipesportugal

Village Idiot 10-05-2009 02:10 PM

Not all hosts will allow you to do this, shared servers aren't meant for any real customization.


All times are GMT. The time now is 02:53 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0