M
Michelle Stone
Hi everybody
I am writing a simple asp.net application using form
authentication. I store the list of all users and their
passwords in an SQL Server database table.
My client recently told me that he wants me to do
something through which only one user can login using any
given account name. I mean to say, for example, when a
user called "abc" is online, another person shouldn't be
allowed to login using the same login.
I thought of many possibilities. I am listing down some
here, along with some reasons why I am reluctant to use
them. If there is any better way, or if you have comments
on any of the following, please share them with me.
1. Use a field in the table called "bLoggedOn" and set it
to true when the user is on.
Problem: How can I know when the user is logged out? What
if the modem-line connection is cut in between? Or what
if the server crashes for five minutes?
2. Use an Application variable (perhaps an array or
something....fyi, the maximum number of users online at
any time is 50). But then again, how can I "log off" a
user if his connection is cut?
In any of the following cases, one thing is very
important. If he closes the browser and attempts to
relogin, he shouldn't get the message "you are already
logged on from another location." The users will be at
the frontdesk of an office and they can't wait for a few
minutes before the server automatically logs them off.
I need to know whether there is any way the server can
know when a guy logs off.
Thanks....
<oops, looks like this message got a bit too long >
I am writing a simple asp.net application using form
authentication. I store the list of all users and their
passwords in an SQL Server database table.
My client recently told me that he wants me to do
something through which only one user can login using any
given account name. I mean to say, for example, when a
user called "abc" is online, another person shouldn't be
allowed to login using the same login.
I thought of many possibilities. I am listing down some
here, along with some reasons why I am reluctant to use
them. If there is any better way, or if you have comments
on any of the following, please share them with me.
1. Use a field in the table called "bLoggedOn" and set it
to true when the user is on.
Problem: How can I know when the user is logged out? What
if the modem-line connection is cut in between? Or what
if the server crashes for five minutes?
2. Use an Application variable (perhaps an array or
something....fyi, the maximum number of users online at
any time is 50). But then again, how can I "log off" a
user if his connection is cut?
In any of the following cases, one thing is very
important. If he closes the browser and attempts to
relogin, he shouldn't get the message "you are already
logged on from another location." The users will be at
the frontdesk of an office and they can't wait for a few
minutes before the server automatically logs them off.
I need to know whether there is any way the server can
know when a guy logs off.
Thanks....
<oops, looks like this message got a bit too long >