Any thought about how can I stop a user from logging into the application
multiple times. I am using forms authentication. 10 1911
Quite a few methods come to mind. put the userIds in an arraylist and store
that in the application - looping through it and checking for an existing
entry whenever someone logs in. Update your database user table with a
field "isLoggedIn" and set it to true.
The problem with these methods is removing the user when he/she logs
out...it's simply if they explicitely log out, but if they simply close
their browser...you'd need to add a timestamp and clean it up routinely.
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Conformix Sales" <sa***@conformix.com> wrote in message
news:6C*****************@fe1.columbus.rr.com... Any thought about how can I stop a user from logging into the application multiple times. I am using forms authentication.
If I use a database table with a "isLoggedIn" field and set it to true on
user login, how do I add a timestamp and clean it up routinely?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Quite a few methods come to mind. put the userIds in an arraylist and store that in the application - looping through it and checking for an existing entry whenever someone logs in. Update your database user table with a field "isLoggedIn" and set it to true.
The problem with these methods is removing the user when he/she logs out...it's simply if they explicitely log out, but if they simply close their browser...you'd need to add a timestamp and clean it up routinely.
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"Conformix Sales" <sa***@conformix.com> wrote in message news:6C*****************@fe1.columbus.rr.com... Any thought about how can I stop a user from logging into the application multiple times. I am using forms authentication.
Well, what I would do is add a second field "lastLoggedIn" as a datetime
and set it to getDate() at the same time you set the IsLoggedIn to true.
Before accepting a login from a user, if lastLoggedIn > 30 minutes (for
example), I would set isLoggedIn to false
then I would only accept logins from people who's isLoggedIn is false
You could make it even better and update the lastLoggedIn field for every
page hit...this would let you be far more responsive...you could change the
maximum login time to 5-10 minutes...depending on what type of application
you have and how often you expect users to hit a new page..
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message
news:ut**************@TK2MSFTNGP09.phx.gbl... If I use a database table with a "isLoggedIn" field and set it to true on user login, how do I add a timestamp and clean it up routinely?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Quite a few methods come to mind. put the userIds in an arraylist and store that in the application - looping through it and checking for an
existing entry whenever someone logs in. Update your database user table with a field "isLoggedIn" and set it to true.
The problem with these methods is removing the user when he/she logs out...it's simply if they explicitely log out, but if they simply close their browser...you'd need to add a timestamp and clean it up routinely.
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"Conformix Sales" <sa***@conformix.com> wrote in message news:6C*****************@fe1.columbus.rr.com... Any thought about how can I stop a user from logging into the
application multiple times. I am using forms authentication.
But how do you catch if a user simply close
their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:u%********************@TK2MSFTNGP15.phx.gbl.. . Well, what I would do is add a second field "lastLoggedIn" as a datetime and set it to getDate() at the same time you set the IsLoggedIn to true.
Before accepting a login from a user, if lastLoggedIn > 30 minutes (for example), I would set isLoggedIn to false then I would only accept logins from people who's isLoggedIn is false
You could make it even better and update the lastLoggedIn field for every page hit...this would let you be far more responsive...you could change the maximum login time to 5-10 minutes...depending on what type of application you have and how often you expect users to hit a new page..
Karl -- MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message news:ut**************@TK2MSFTNGP09.phx.gbl... If I use a database table with a "isLoggedIn" field and set it to true on user login, how do I add a timestamp and clean it up routinely?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... > Quite a few methods come to mind. put the userIds in an arraylist and > store > that in the application - looping through it and checking for an existing > entry whenever someone logs in. Update your database user table with a > field "isLoggedIn" and set it to true. > > The problem with these methods is removing the user when he/she logs > out...it's simply if they explicitely log out, but if they simply close > their browser...you'd need to add a timestamp and clean it up > routinely. > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Conformix Sales" <sa***@conformix.com> wrote in message > news:6C*****************@fe1.columbus.rr.com... >> Any thought about how can I stop a user from logging into the application >> multiple times. I am using forms authentication. >> >> > >
You'll always have that problem. That's wha tthe lastLoggedIn time is
for.....if they've been idle for 5 minutes, you can reset the account and
assume they simply closed their browser. You can also use javascript events
such as onbeforeunload in IE to work some magic...but I agree it'll always
be a problem...it's your only real solution though...
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl... But how do you catch if a user simply close their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:u%********************@TK2MSFTNGP15.phx.gbl.. . Well, what I would do is add a second field "lastLoggedIn" as a
datetime and set it to getDate() at the same time you set the IsLoggedIn to true.
Before accepting a login from a user, if lastLoggedIn > 30 minutes (for example), I would set isLoggedIn to false then I would only accept logins from people who's isLoggedIn is false
You could make it even better and update the lastLoggedIn field for
every page hit...this would let you be far more responsive...you could change the maximum login time to 5-10 minutes...depending on what type of
application you have and how often you expect users to hit a new page..
Karl -- MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message news:ut**************@TK2MSFTNGP09.phx.gbl... If I use a database table with a "isLoggedIn" field and set it to true
on user login, how do I add a timestamp and clean it up routinely?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... > Quite a few methods come to mind. put the userIds in an arraylist and > store > that in the application - looping through it and checking for an existing > entry whenever someone logs in. Update your database user table with
a > field "isLoggedIn" and set it to true. > > The problem with these methods is removing the user when he/she logs > out...it's simply if they explicitely log out, but if they simply
close > their browser...you'd need to add a timestamp and clean it up > routinely. > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Conformix Sales" <sa***@conformix.com> wrote in message > news:6C*****************@fe1.columbus.rr.com... >> Any thought about how can I stop a user from logging into the application >> multiple times. I am using forms authentication. >> >> > >
Thanks!
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... You'll always have that problem. That's wha tthe lastLoggedIn time is for.....if they've been idle for 5 minutes, you can reset the account and assume they simply closed their browser. You can also use javascript events such as onbeforeunload in IE to work some magic...but I agree it'll always be a problem...it's your only real solution though...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message news:Ot**************@TK2MSFTNGP15.phx.gbl... But how do you catch if a user simply close their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:u%********************@TK2MSFTNGP15.phx.gbl.. . > Well, what I would do is add a second field "lastLoggedIn" as a datetime > and set it to getDate() at the same time you set the IsLoggedIn to > true. > > Before accepting a login from a user, if lastLoggedIn > 30 minutes (for > example), I would set isLoggedIn to false > then I would only accept logins from people who's isLoggedIn is false > > You could make it even better and update the lastLoggedIn field for every > page hit...this would let you be far more responsive...you could change > the > maximum login time to 5-10 minutes...depending on what type of application > you have and how often you expect users to hit a new page.. > > Karl > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Leon" <vn*****@msn.com> wrote in message > news:ut**************@TK2MSFTNGP09.phx.gbl... >> If I use a database table with a "isLoggedIn" field and set it to true on >> user login, how do I add a timestamp and clean it up routinely? >> >> "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME >> net> >> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... >> > Quite a few methods come to mind. put the userIds in an arraylist >> > and >> > store >> > that in the application - looping through it and checking for an > existing >> > entry whenever someone logs in. Update your database user table >> > with a >> > field "isLoggedIn" and set it to true. >> > >> > The problem with these methods is removing the user when he/she logs >> > out...it's simply if they explicitely log out, but if they simply close >> > their browser...you'd need to add a timestamp and clean it up >> > routinely. >> > >> > Karl >> > >> > -- >> > MY ASP.Net tutorials >> > http://www.openmymind.net/ >> > >> > >> > "Conformix Sales" <sa***@conformix.com> wrote in message >> > news:6C*****************@fe1.columbus.rr.com... >> >> Any thought about how can I stop a user from logging into the > application >> >> multiple times. I am using forms authentication. >> >> >> >> >> > >> > >> >> > >
May I know why you are not considering Session variables
kumar -----Original Message----- But how do you catch if a user simply close their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind
REMOVEMETOO . ANDME net>wrote in message news:u%23S%23% 23***********@TK2MSFTNGP15.phx.gbl... Well, what I would do is add a second
field "lastLoggedIn" as a datetime and set it to getDate() at the same time you set the
IsLoggedIn to true. Before accepting a login from a user, if lastLoggedIn >
30 minutes (for example), I would set isLoggedIn to false then I would only accept logins from people who's
isLoggedIn is false You could make it even better and update the
lastLoggedIn field for every page hit...this would let you be far more
responsive...you could change the maximum login time to 5-10 minutes...depending on what
type of application you have and how often you expect users to hit a new
page.. Karl -- MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message news:ut**************@TK2MSFTNGP09.phx.gbl... If I use a database table with a "isLoggedIn" field
and set it to true on user login, how do I add a timestamp and clean it up
routinely? "Karl Seguin" <karl REMOVE @ REMOVE openmymind
REMOVEMETOO . ANDME net> wrote in message news:%
23***************@TK2MSFTNGP10.phx.gbl... > Quite a few methods come to mind. put the userIds in
an arraylist and > store > that in the application - looping through it and
checking for an existing > entry whenever someone logs in. Update your
database user table with a > field "isLoggedIn" and set it to true. > > The problem with these methods is removing the user
when he/she logs > out...it's simply if they explicitely log out, but
if they simply close > their browser...you'd need to add a timestamp and
clean it up > routinely. > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Conformix Sales" <sa***@conformix.com> wrote in
message > news:6C*****************@fe1.columbus.rr.com... >> Any thought about how can I stop a user from
logging into the application >> multiple times. I am using forms authentication. >> >> > >
.
What do you mean?
"Kumar Reddi" <Ku********@REMOVETHIS.GMAIL.COM> wrote in message
news:3a****************************@phx.gbl... May I know why you are not considering Session variables
kumar
-----Original Message----- But how do you catch if a user simply close their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>wrote in message news:u%23S%23% 23***********@TK2MSFTNGP15.phx.gbl... Well, what I would do is add a second field "lastLoggedIn" as a datetime and set it to getDate() at the same time you set the IsLoggedIn to true. Before accepting a login from a user, if lastLoggedIn > 30 minutes (for example), I would set isLoggedIn to false then I would only accept logins from people who's isLoggedIn is false You could make it even better and update the lastLoggedIn field for every page hit...this would let you be far more responsive...you could change the maximum login time to 5-10 minutes...depending on what type of application you have and how often you expect users to hit a new page.. Karl -- MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message news:ut**************@TK2MSFTNGP09.phx.gbl... If I use a database table with a "isLoggedIn" field and set it to true on user login, how do I add a timestamp and clean it up routinely? "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:% 23***************@TK2MSFTNGP10.phx.gbl... > Quite a few methods come to mind. put the userIds in an arraylist and > store > that in the application - looping through it and checking for an existing > entry whenever someone logs in. Update your database user table with a > field "isLoggedIn" and set it to true. > > The problem with these methods is removing the user when he/she logs > out...it's simply if they explicitely log out, but if they simply close > their browser...you'd need to add a timestamp and clean it up > routinely. > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Conformix Sales" <sa***@conformix.com> wrote in message > news:6C*****************@fe1.columbus.rr.com... >> Any thought about how can I stop a user from logging into the application >> multiple times. I am using forms authentication. >> >> > >
.
Why dont you add the username to a session variable, like
Session["userName"] = "something"; Then keep checking the
existence of this session variable. Session has a fixed
timeout period. By default 20 minutes idle time, after
which all the session variables are cleared. So, this
saves you from multiple calls to database. Asp.Net take
care of session clearance, if the user closes the browser.
Kumar -----Original Message----- What do you mean?
"Kumar Reddi" <Ku********@REMOVETHIS.GMAIL.COM> wrote in
messagenews:3a****************************@phx.gbl... May I know why you are not considering Session variables
kumar
-----Original Message----- But how do you catch if a user simply close their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>wrote in message news:u%23S%23% 23***********@TK2MSFTNGP15.phx.gbl... Well, what I would do is add a second field "lastLoggedIn" as a datetime and set it to getDate() at the same time you set the IsLoggedIn to true. Before accepting a login from a user, if lastLoggedIn 30 minutes (for example), I would set isLoggedIn to false then I would only accept logins from people who's isLoggedIn is false You could make it even better and update the
lastLoggedIn field for every page hit...this would let you be far more responsive...you could change the maximum login time to 5-10 minutes...depending on what type of application you have and how often you expect users to hit a new page.. Karl -- MY ASP.Net tutorials http://www.openmymind.net/
"Leon" <vn*****@msn.com> wrote in message news:ut**************@TK2MSFTNGP09.phx.gbl... > If I use a database table with a "isLoggedIn" field
and set it to true on> user login, how do I add a timestamp and clean it up routinely?> > "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>> wrote in message news:% 23***************@TK2MSFTNGP10.phx.gbl...> > Quite a few methods come to mind. put the userIds
in an arraylist and> > store > > that in the application - looping through it and checking for an existing > > entry whenever someone logs in. Update your database user table with a> > field "isLoggedIn" and set it to true. > > > > The problem with these methods is removing the user when he/she logs> > out...it's simply if they explicitely log out, but if they simply close> > their browser...you'd need to add a timestamp and clean it up> > routinely. > > > > Karl > > > > -- > > MY ASP.Net tutorials > > http://www.openmymind.net/ > > > > > > "Conformix Sales" <sa***@conformix.com> wrote in message> > news:6C*****************@fe1.columbus.rr.com... > >> Any thought about how can I stop a user from logging into the application > >> multiple times. I am using forms authentication. > >> > >> > > > > > >
.
.
how do I keep checking the existence of this session variable even if the
user closes the browser?
"Kumar Reddi" <Ku********@REMOVETHIS.GMAIL.COM> wrote in message
news:43****************************@phx.gbl... Why dont you add the username to a session variable, like Session["userName"] = "something"; Then keep checking the existence of this session variable. Session has a fixed timeout period. By default 20 minutes idle time, after which all the session variables are cleared. So, this saves you from multiple calls to database. Asp.Net take care of session clearance, if the user closes the browser.
Kumar
-----Original Message----- What do you mean?
"Kumar Reddi" <Ku********@REMOVETHIS.GMAIL.COM> wrote in messagenews:3a****************************@phx.gbl... May I know why you are not considering Session variables
kumar
-----Original Message----- But how do you catch if a user simply close their browser?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:u%23S%23% 23***********@TK2MSFTNGP15.phx.gbl... > Well, what I would do is add a second field "lastLoggedIn" as a datetime > and set it to getDate() at the same time you set the IsLoggedIn to true. > > Before accepting a login from a user, if lastLoggedIn
30 minutes (for > example), I would set isLoggedIn to false > then I would only accept logins from people who's isLoggedIn is false > > You could make it even better and update the lastLoggedIn field for every > page hit...this would let you be far more responsive...you could change > the > maximum login time to 5-10 minutes...depending on what type of application > you have and how often you expect users to hit a new page.. > > Karl > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Leon" <vn*****@msn.com> wrote in message > news:ut**************@TK2MSFTNGP09.phx.gbl... >> If I use a database table with a "isLoggedIn" field and set it to true on >> user login, how do I add a timestamp and clean it up routinely? >> >> "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> >> wrote in message news:% 23***************@TK2MSFTNGP10.phx.gbl... >> > Quite a few methods come to mind. put the userIds in an arraylist and >> > store >> > that in the application - looping through it and checking for an > existing >> > entry whenever someone logs in. Update your database user table with a >> > field "isLoggedIn" and set it to true. >> > >> > The problem with these methods is removing the user when he/she logs >> > out...it's simply if they explicitely log out, but if they simply close >> > their browser...you'd need to add a timestamp and clean it up >> > routinely. >> > >> > Karl >> > >> > -- >> > MY ASP.Net tutorials >> > http://www.openmymind.net/ >> > >> > >> > "Conformix Sales" <sa***@conformix.com> wrote in message >> > news:6C*****************@fe1.columbus.rr.com... >> >> Any thought about how can I stop a user from logging into the > application >> >> multiple times. I am using forms authentication. >> >> >> >> >> > >> > >> >> > >
.
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steve Meier |
last post by:
Environment:
SQLServer Developer Edition on Machine A
Enterprise Manager running on remote machine B
Both machines are in the same subnet
I open Enterprise Mgr on Machine A, right click...
|
by: William Logan |
last post by:
Hello all DBAs
what is the best methodolgy to replace a server with a new server in a
multiple sql server environment.. Is is using back up/restore to
another/bridge type server then rename...
|
by: Sameer |
last post by:
one important problem i am facing is that my web solution
(asp.net) will be deployed on a webfarm. I am using sql
server session management on clustered sqlservers. but as
i need to prevent...
|
by: Shashi |
last post by:
My development environment is ASP.Net 1.1.
When the user does multiple logins to the system and navigates to different
screens and clicks back button sometimes it reading the session variables...
|
by: anoj |
last post by:
Hi All
i need to prevent multiple logins from the same user at the same time.
what is the best way to do this .
How can i detect if a user closes the browser window without logging
out so tht...
| |
by: Nicolas Bottarini |
last post by:
Hi!!
I have a site with a backend subdirectory with the backend of the site.
I need that the site to have one login and the backend directory
another one. Is this possible with Forms...
|
by: Gleep |
last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this.
The goal I don't want clients to give out their usernames and passwords to friends, since the site...
|
by: Paul |
last post by:
Hi,
The problem....
We have 2 webservers, behind a Load Balancer.
We have set the website on both boxes to store sessions in SQLServer.
To prevent people sharing the logins, we have...
|
by: Bhavini |
last post by:
Hi All,
I have to prevent multiple logins for the same user accessing at same time.
i.e. if xyz user is active, no other login should be allowed for the same
user ID.
I thought of saving...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |