Jump to content

I'm losing session variables. random, usually after about 1/2 hour.


noamkrief

Recommended Posts

Hi everyone. I have this big issue that i'm thinking might be related to my php.ini file. I have a clean install of xampp on win32.

humm - maybe it's my code :)

 

I have a secured site I'm using for time clocks for our employees but it keeps kicking them out.

When they sign in after authentication of the db, I do:

session_start();

$_SESSION['user_id'] = $USER_ID_FROM_DB;

i'm also registring some security tokens in sessions etc...

 

At the top of every secure page, I have a require('./security.php');

security.php has something like:

$sql = mysql_query("select * from employee where PER_ID = $_SESSION[user_id]");

if mysql query failes - it kicks them back to login page.

 

On the login page I'm doing debugging. I have it echo $_SESSSION['user_id'] which shows empty after the sessions get magically wiped out!

 

What could be the cause? Why are the sessions not sticking for very long? The longest I have been able to stay on is about 1 hour. It has nothing to do with browser inactivity or anything like that because even when I'm using it, I all the sudden get kicked off.

 

Thank you :)

 

 

sorry it took me a while to reply - i wasn't getting notification email when there was a reply to my post.

 

session.gc_maxlifetime = 1440

 

I'm using NTFS

 

Thanks alot at helping me troubleshoot this :)

 

Noam

 

 

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.