Page 1 of 1

Session Problems

Posted: Sat Jul 09, 2005 12:26 am
by neugent
How can i prevent my sessions from expiring just like this forum? My clients are getting annnoyed that they get to re-login again and again everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in advance.e_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();

Am i doing this correctly? or not...
Thanks in advance.g my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correcton_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();

Am i doing this correctly? or not...
Thanks in advance.;
$cache_expire = session_cache_expire();

session_start();

Am i doing this correctly? or not...
Thanks in advance.ing annnoyed that they get to re-login again and again everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

[pmy sessions from expiring just like this forum? My clients are getting annnoyed that they get to re-login again and again everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in advance.verytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();[/php:1owsers yet. I think the duration is around 30 minutes. 

Ive tried using the following:

Code: Select all

session_cache_limiter('pagain everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes. 

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in advance. everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in aexpire(120);
$cache_expire = session_cache_expire();

session_start();

Am i doing this correctly? or not...
Thanks in advance.not...
Thanks in advance.to re-login again and again everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in advance.um? My clients are getting annnoyed that they get to re-login again and again everytime they stop browsing my site even though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in advance.ven though they havent logged out or closed their browsers yet. I think the duration is around 30 minutes.

Ive tried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am ried using the following:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();
Am i doing this correctly? or not...
Thanks in advance.session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

session_cache_expire(120);
$cache_expire = session_cache_expire();

session_start();

Am i doing this correctly? or not...
Thanks in advance.

Posted: Sat Jul 09, 2005 12:40 am
by method_man
it uses miliseconds. 1000 is one second i believe

Posted: Sat Jul 09, 2005 1:21 am
by neugent
Can any admin/mods move this topic over the PHP-Code Section? I mistakenly posted this over the general discussion.

So Sorry.

Posted: Sat Jul 09, 2005 9:02 am
by shiznatix
i think you will be forgiven this time! no but seriously use this because its an amazing function that will do just what you need

session_set_cookie_params()

session timeout issues

Posted: Fri Jul 15, 2005 7:54 am
by thedamo
You could always change the lifetime directive in the php.ini file as below:

session.cookie_lifetime = 0

Lifetime in seconds of cookie or, if 0, until browser is restarted.

Does this help? Or do specifically need to do it from within php?

Posted: Fri Jul 15, 2005 8:17 am
by patrikG
moved to PHP Code

Posted: Tue Jul 19, 2005 4:43 am
by neugent
I have found the problem regarding this, it seems that Apache cleans up the temp folder with a specified time, which causes my session's timeouts.

To solve this, in your .htacess add the following:

php_value session.save_path /home/mytemp/

Make sure you have created the mytemp folder and had given access to it, i have set mine to 777.