Jump to content

Session Timing out too soon.


exally

Recommended Posts

This will have to be incldue on every page.

<?php
ini_set('session.gc_maxlifetime',86400);
ini_set('session.cookie_lifetime',86400);
session_name('FILEITHERE);
?>

unfortunately my server has disabled this method, however i have put this in my .htaccess file and appears correctly when i do phpinfo() and each page where i call session_start()

If you are on a shared web server, the shortest session.gc_maxlifetime of all the scripts running on the server wins.

 

To get your session.gc_maxlifetime setting to apply only to your session data files, you must set session.save_path to be to a private folder within your account's folder tree so that your session data files are stored separately.

If you are on a shared web server, the shortest session.gc_maxlifetime of all the scripts running on the server wins.

 

To get your session.gc_maxlifetime setting to apply only to your session data files, you must set session.save_path to be to a private folder within your account's folder tree so that your session data files are stored separately.

in order to be sure, I assume that the files are stored in /tmp - would it be better to create /tmp/custom or /tmp2

 

Also do i have to create the folder and set certain permissions or would PHP handle that?

If you are on a shared web server, the shortest session.gc_maxlifetime of all the scripts running on the server wins.

 

To get your session.gc_maxlifetime setting to apply only to your session data files, you must set session.save_path to be to a private folder within your account's folder tree so that your session data files are stored separately.

 

thanks, testing this now! It does make sense as we are sharing the server but not the document root if you get me.

we are home2 where i assume there is a home

You need to apply the proper setting to the folder yourself, which should be some thing along the lines of no public access and only read, write, executable by the scripts. The folder should ideally be hidden from the web, and thus only accessable by the scripts and you as the ftp admin.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.