Blocking multiple login using same username at a time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
angelena
Forum Commoner
Posts: 53
Joined: Mon Nov 22, 2004 4:10 am

Blocking multiple login using same username at a time

Post by angelena »

Code: Select all

<?php
if (!tep_session_is_registered('customer_first_name') && !tep_session_is_registered('customer_id')  || $customer_type!='Center' && $customer_type!='Staff') {
		header("Location: log_off.php");
	}
?>

Above is part of my code to detect onthe session on each login member..i would like to restrict only one login using the same username at one time...emm..can anyone show me the way how shud i start from here?

Thanks alot ya :wink:
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

every time someone logs in, update has last_logged_in attribute, and save it in the session too.

every time someone requests a page, compare if the value in the session and the database for last_logged_in are still the same.
Post Reply