Re: [PHP] Multiple session




Hi,

The idea is to add some kinda ping to your web site with Ajax so as far as
you receive pings you know that the use kept his/her browser open and when
it stops sending pings either the browser is closed or the net connection is
down, and then delete the user session and try to log it out.

and for preventing multiple logins you can make a database and track users,
when a user logs in you put a record with username and/or userid in that
database and when a user tries to login again just check if there is an old
record with the same username/userid. but don't forget to delete this record
when user logs out! or the session ends.

have a good coding


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.



Best Regards,

/Erfan

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




--
View this message in context: http://www.nabble.com/Multiple-session-tf4157960.html#a11837017
Sent from the PHP - General mailing list archive at Nabble.com.
.



Relevant Pages

  • Re: Force Relogin. IIS6, ASP.NET app, IE6+ browser
    ... now it appears you are suggesting I either write a custom authentication ... cookies/tokens involved; IIS has no idea what a session is; IIS does ... not prompt with a login dialog. ... The problem you face is that a browser will automatically attempt ...
    (microsoft.public.inetserver.iis.security)
  • Re: php sessions problem - wrong logic maybe
    ... Also when I logoff (wchich destroys session and goes back to login screen) everything works fine. ... The problem starts when I close the browser without login off. ... switch{case 1: include "$LOGINDIR/menu1.php"; global $LOGINDIR; ...
    (comp.lang.php)
  • Re: only one X11 application
    ... this should be a browser, ... the user should fall back to login. ... the X session will end too. ... It will start the X server and then run ...
    (comp.unix.solaris)
  • session destroy problems
    ... Also when I logoff (wchich destroys session and goes back to login screen) everything works fine. ... The problem starts when I close the browser without login off. ... >> global $LOGINDIR; ...
    (alt.php)
  • Re: ASP sessionstate
    ... ASP doesn't know or care what browser it ... ticket number given when the first item is added to the cart. ... How can a Response.Write write to the server screen? ... :> delete the cart file and set the session ...
    (microsoft.public.inetserver.asp.general)