Please advice once the session is created by A client and B client logs in with the same username and password I want to logout A client
Is this possible?

<?php
	//Start session
	session_start();
	
	//Check whether the session variable SESS_MEMBER_ID is present or not
	if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
		header("location: access-denied.php");
		exit();
	}
?>

Recommended Answers

All 2 Replies

Sessions data is stored on the server, it got nothing to do in case some client logs in and then some other and then again some other.
be clear exactly what you want to achieve, i think just the user loging verify, if thats it only checking the if(isset($_session ) ) will do the same thing.
I cant find the need to use || (trim($_SESSION) == '')

I was looking for 1 user account, 1 login. If the owner of the user shares the account still 1 should login at anytime.
There should be no chance two client logging in with the same username at the same time

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.