Re: Multiple session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-07-27 at 15:55 +0200, Erfan Shirazi wrote:
> Hi all
> 
> 
> I have a problem which I need some help with.
> I have a e-commerce site were the user must log in in order to use some 
> of the functions. But I only want 1 active session for each user, so the 
> user should not be able to have 2 browsers opened and being able to log 
> in with both.
> 
> 
> So I need to somehow know the difference between when a user has just 
> shutdown the browser without correct login and when the user has logged 
> out correctly.
> 
> Today we use DB in order to make this happen but then the user is able 
> to login twice but as soon as he clicks on something (new PHP call) in 
> the previous session he gets kicked out from his previous session.
> 
> I want to somehow see if the user already has a browser opened with a 
> active session and tell him to use that one instead. And if the browser 
> is closed but he has not logged out correctly then he should be able to 
> log in again.

You CANNOT know if the user has exited their session. Nothing is
returned to your server by the browser indicating the browser was
closed. All you can do is detect that a second session is being
requested for a user and either shutdown the first session, or indicate
to the requester of the second session that the first session must
expire before a new session can be opened.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux