Re: Sessions and closing the browser
From: Tim Van Wassenhove (euki_at_pi.be)
Date: 09/25/04
- Next message: Andy Hassall: "Re: URL and .htaccess"
- Previous message: Jamie Davison: "Re: a fast line counter"
- In reply to: Theo: "Sessions and closing the browser"
- Next in thread: Ian.H: "Re: Sessions and closing the browser"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Sep 2004 23:16:37 GMT
In article <Xns956EA0914D80densnews123@216.168.3.44>, Theo wrote:
> Question for the group
>
> The authentication system for the site Im working on seems to function
> properly and all is good. A session keeps track of everything and a
> cookie is used to accept or deny access... sounds as it should be I hope.
> Then when all is done logging out destroys everything and the pages are
> no longer accessable. Good so far.
>
> But two things come to mind: one is preventing multiple logins of the
> user/password. The solution from what Ive read seems to be using another
> variable to check whether or not the user is already logged in (a simple
> yes or no). Simple enough. I imagine logging out normally and deleting
> all values removes this and then the cookie is deleted. But, what if the
> browser is simply closed? If I understand how everything works the cookie
> will still be there for a set period until its removed automatically.
> What if the user logs in, closes the browser, and tries to log in again?
> Is the value saying the login already exists still there? Or am I
> thinking I need a solution to a problem that is already transparently
> handled?
Instead of yes/no store the timestamp. And save that timestamp in the
session.
Everytime a user requests as page, compare the session timestamp with
the timestamp in the database.
If a new login has been done, the timestamp will be different.
-- Tim Van Wassenhove <http://www.timvw.info>
- Next message: Andy Hassall: "Re: URL and .htaccess"
- Previous message: Jamie Davison: "Re: a fast line counter"
- In reply to: Theo: "Sessions and closing the browser"
- Next in thread: Ian.H: "Re: Sessions and closing the browser"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|