Next Generation Emulation banner
1 - 3 of 3 Posts

· Registered
Joined
·
1,472 Posts
Discussion Starter · #1 ·
Hey guys. I am working on a website for a client, and I need to be able to store global variables so that I can access them in other pages. For example, I want to be able to store the time when a user logs in and then subtract this value from the current time periodically and then lock the user out of the system. So if the user is logged in for 15 minutes, I want to lock him out of the system.

The problem is that I can't seem to find a way to store the time, or any other variable in the session. I have tried session_register(var name) and then tried to access the variable using $_SESSION(var name) but that doesn't work.

Any help would greatly be appreciated. Thanks.
 

· Registered
Joined
·
839 Posts
Perhaps $_SESSION(var name) doesn't work because $_SESSION is an array, however if you do something like $_SESSION["login_time"] it should work fine. Also you need to do session_start() before ever using the $_SESSION global variable. Good luck! :)
 
1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top