answersLogoWhite

0


Best Answer

Assuming you are using a User database and sessions, simply add a Session key. Auto generate this key as follows:

$newsession_key = SHA1( RAND(100000000,999999999));

Enter this in the database on the user row when logging in and store it in a session and in the database. Then on your code where you define the user logged in status you add something like:

$database_session = $DATABASE['sessionkey'];

If($database_session != $_SESSION['sessionkey']){

Unset($_SESSION['username'],$_SESSION['password'],$_SESSION['sessionkey']); #A*

}

A* Add in any sessions you use to keep the user logged in.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you stop double logging in using PHP and MySQL?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you stop logging in the amazon?

make it illegle


How do you quit the game immortal night?

You stop logging in!


Why should people stop logging?

to save the environment


How do you delete a roblox account?

You can't delete your account, you have to just stop logging in.


How can we encourage people to stop logging our environment?

Its very hard to encourage a large number of people to do something foolish like stop logging. However such things have been achieved many times by widespread propaganda campaigns.


Solutions of scarcity?

Solution? example. conserve water. stop illegal logging. etc


Should mining and logging stop if there is endangered species present in that area?

a da OF COURSE


How do you sign out of your mobile Twitter account?

It depends on what application/method you are using. Most versions will have a "log out" button. Common problems which stop you from logging out are an out of date version of an application or being in the wrong time zone.


How can you stop a user from logging on in Linux?

Just change their password to something unguessable with the passwd command.


What is the Canadian government doing to stop deforestation in Canada?

National Governments such as the one in Canada do pass legislation to regulate if logging is allowed, where it is allowed, what safeguards are to be used on how the logging is to be done, etc


What year did ford stop using the ohv engine?

The over head valve engine is still in use. Ford did not stop using it, however, the way the valves are opened and could be with single or double over head cams.


Should government prohibit logging?

There isn't a correct answer for this, there's three sides on this. Governments like logging because it makes their economy better. Environmentalists don't because it endangers too many creatures. And then there's one right in the middle, to not totally stop logging but to decrease the amount of logging each year. ?!?!?!?!?!?!?!?!?!?!?!Which one do you agree with?!?!?!?!?!?!?!?!?!?!?!?