Re: session_decode from session handler
| From: | Richard Lynch | Date: | Wed, 25 Jul 2007 04:44:31 +0000 |
| Subject: | Re: session_decode from session handler | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259484@lists.php.net to get a copy of this message | ||
On Sat, July 21, 2007 11:19 pm, Jeffery Fernandez wrote:
> I have a similar problem I am facing with session data stored in the
> database
> from the set_session_handler.
>
> What I am trying to do is show a list of online users and the page
> they are
> currenlty viewing. For this purpose I am query the sessions table to
> get the
> list of session and from that I loop through to get the session data
> of each
> online user. But for some reason, I cannot decode/un-serialise the
> session
> data. Any pointers ?
Don't do that. :-)
Instead of crawling through everybody's session data all the time,
just have each page hit "register" the user's current page and
timestamp in their DB profile.
Then a simple SQL query against the DB tells you who is looking at what.
The session data could easily get much much much to big to load/decode
easily/quickly.
A single update query on a pageview should not kill you.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?