i trying to write a script so that it does,nt allow the user to login again if already logged in...whether he tries from other browser..................
wat i m doing is setting a value in database to 1 if he logs in and 0 if he logs out .......den i check this value on login page to inform him that he is already logged in......but the problem is if user closes the window without logging out .....it shows them dat they are already logged in....... but wat to do to make them login again...........
ramseswar
0
Newbie Poster
Recommended Answers
Jump to PostUse Sessions for authentication. They will log the user off when the browser is closed. You shouldn't need to store a value in the db unless you want to show users activity (last login at...)
Jump to PostSessions would work the best for this, if you add
<? session_start(); ?>
at the very beginning of your script. You can set a session variable by simply adding a value to it. For example your script may look like this:This is how to set the session …
All 6 Replies
buddylee17
216
Practically a Master Poster
gralex07
1
Newbie Poster
ramseswar
commented:
it he;ped me a lot
+1
ryan_vietnow
13
Posting Pro
ramseswar
0
Newbie Poster
nikesh.yadav
4
Posting Whiz in Training
cecece
0
Newbie Poster
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.