-
session question
hi this is more of a theory question,
i have a login page all working fine etc... it creates a cookie
in myglobal .asx file is that what can i use that to write to the database
for example what i want is that i write to the database a 1 in a new column i create called logged in,
therefore no one else can log in if column logged in is set to 1 for that user
can these inserts be done on session start and session end from my point of view
-
Re: session question
errrr...so you only want one person ever to log into the DB?
Or do you only want to have one user logging in to only one session?
Ie they can't log in using 2 Pcs.
Woka
-
Re: session question
the second one
cant use 2 pcs
-
Re: session question
OK...you would update the DB after you validate the user login, then in Session_end, or when the user clicks logoff, you would update the Db to say they were already logged in.
What I would do is create a GUID or someting and store than it the DB and in the session. When they request a page I would check the value of the GUID in session against the DB one. If it's different, meaning they logged into another PC, then don't let them do anything, show an error page saying they are logged out of this session.
Make sesne?
Woka
-
Re: session question
i think wot i can do is,
when i validate a user,
one of the validations shall be that the column logged_in is 0
then when they are vlidate i write a 1 to the column logged in
in session end then i write a 0 back to the db
is this right