php-db | 2004071
Date: 07/15/04
- Next message: NIPP, SCOTT V (SBCSI): "[PHP-DB] LAST_INSERT_ID?????"
- Previous message: Peter Westergaard: "[PHP-DB] Re: Restrict account access to single user"
- In reply to: veditio <email protected>: "[PHP-DB] Restrict account access to single user"
- Next in thread: Miles Thompson: "Re: [PHP-DB] Re: Restrict account access to single user"
- Reply: Miles Thompson: "Re: [PHP-DB] Re: Restrict account access to single user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <071520041609.6071.40F6AC330005C593000017B722007354469B020103040A0B <email protected>>, veditio <email protected> wrote:
> Because this is a revenue-based site, and users buy a password for access, we're wondering what the best php/mysql mechanism would be to allow only one person to access their account at a time.
> In other words, how do we prevent two users from using the same password to access the same account at the same time?
If a user logs in:
store the login timestamp in the database
store the uid and timestamp in a session variable.
If a user requests a page:
compare the uid and timestamp in the session with the ones in the database.
This way:
Every user that tries to login with a valid uid/pwd gets access.
Every session with the same uid but older timestamp expires.
Don't applaud, just throw money :D
-- Tim Van Wassenhove <http://home.mysth.be/~timvw>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: NIPP, SCOTT V (SBCSI): "[PHP-DB] LAST_INSERT_ID?????"
- Previous message: Peter Westergaard: "[PHP-DB] Re: Restrict account access to single user"
- In reply to: veditio <email protected>: "[PHP-DB] Restrict account access to single user"
- Next in thread: Miles Thompson: "Re: [PHP-DB] Re: Restrict account access to single user"
- Reply: Miles Thompson: "Re: [PHP-DB] Re: Restrict account access to single user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

