Re: http://gateway.digitaria.com/~chris/php/mysql_session_handler/
| From: | Ed Lazor | Date: | Sun, 26 Nov 2000 21:56:44 +0000 |
| Subject: | Re: http://gateway.digitaria.com/~chris/php/mysql_session_handler/ | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27282@lists.php.net to get a copy of this message | ||
At 01:17 PM 11/26/2000 -0800, you wrote:
Thanks for the help =) I can start sessions, register, retrieve, and unregister variables. I was able to quickly setup a system where people can log into the site, etc. I also setup a neat little extra. By adding two additional fields to the sessions database (username, url), and adding these fields to the function that writes the sessions (listed below), I'm able to tell who's logged in and which page they are on. Pretty cool Ah. I would usually just store those as session variables, but your way is definitely easier to use from the MySQL query tool.Really? How would you access another session's variables? The goal was to be able to log in as the Admin and get a full listing of who's logged in and what they are doing. I didn't think it was possible to access variables between sessions? hmmm now that I'm thinking of it, I guess you could probably de-serialize the other session variables and access them that way. Is that what you're doing?
It sounds like you might have a problem with the expiration date for your session cookie. My code isn't involved at that point, so you can use the php configuration directives (e.g. session.cookie_lifetime) to control this.k, I just set session.cookie_lifetime to the same value as session.gc_maxlifetime. That should fix the problem, right? Of course, I guess that has a negative aspect... it means people will automatically have to relogin every hour or whatever I set the value to. :( hmmm What do you think? -Ed