On 4/5/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> should read "de"serialized data, sorry. let me try to explain:
>
> after successful login i write a status value "logged_in" = 1
> into the session. this helps granting access to certain actions.
> Users should be allowed to log in only *once*. so during
> login i must search the whole session table for that user
> id, and then check if there is a session still existing with that
> id (for example because he closed the browser).
> if there is a valid session, then i'd like to deny access.
> if the session is expired, and still there (because _gc has
> *not* been called in the meantime) i'd want to force _gc.
>
> i might set the _gc probability to 1 to achieve this, but
> i dislike the idea...
> anyways, apart from read/write to the current session there
> seems to be no other routines out of the box for my needs.
> thats why i considered setting up a model for the session
> table. but when it comes to (de)serialisation i will wonder
> how to do it...
>

Ah, I understand.  Perhaps the easiest way to solve this problem is to
create a custom session handler that uses the login ID as the key for
the session.  You can't have more than one session with the same login
ID that way, so that stops multiple logins.

I hope that makes sense, and I'm sure the people smarter than me
around here (for there are many) will correct me.

Preventing multiple logins is not an easy task to solve without a
central location that is keeping track of who is logged in.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digital photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to