Thursday, March 29, 2012

Single User Login At A Time

Hi,
Does anyone knows how to control user login that only a single userid can
login at a time?
Thanks
JoeyYou could store the ID of all users in an Application variable or a database
and check if that one is in use. Of course you'd need to make sure the
person logged out properly so you could remove the ID.
"Joey Lee" <joeylta1979@.hotmail.com> wrote in message
news:O5r8HJlOFHA.3600@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Does anyone knows how to control user login that only a single userid can
> login at a time?
> Thanks
> Joey
>
Thank. Actually that is the problem which i am currently facing. I keep the
userid in the cache and do checking. But if the user just click on the "x"
button closing the browser. he will be log out until the cache expire or my
undetermined session_end method in global.asax fires to kill of the
information in cache.
Is there a better way'
Joey
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:eesuRMlOFHA.524@.TK2MSFTNGP09.phx.gbl...
> You could store the ID of all users in an Application variable or a
> database and check if that one is in use. Of course you'd need to make
> sure the person logged out properly so you could remove the ID.
> "Joey Lee" <joeylta1979@.hotmail.com> wrote in message
> news:O5r8HJlOFHA.3600@.TK2MSFTNGP10.phx.gbl...
>
This is a very common problem. Too bad that there isn't a standard HTML tag
that allows something like this:
<ONCLOSE href=http://mysite.com/logout.aspx />
I'm not sure if JavaScript can handle this. Downside of JavaScript is that
it can be disabled by the user, or unsupported by browser. I think and
<onclose> html tag should've been part of standard html.
Since it isn't, I think using timeouts is the only way. You can try limiting
the timeout to 5 minutes, and every time there is activity on the webpage,
you reset the timer. This means if the user stares at the same page for 5
minutes, the login session expires.
This could be eased with a JavaScript code that calls a
http://mysite.com/keepalive.aspx, to reset the timer.
Lisa
"Joey Lee" <joeylta1979@.hotmail.com> wrote in message
news:ecNmTKnOFHA.2384@.tk2msftngp13.phx.gbl...
> Thank. Actually that is the problem which i am currently facing. I keep
> the userid in the cache and do checking. But if the user just click on the
> "x" button closing the browser. he will be log out until the cache expire
> or my undetermined session_end method in global.asax fires to kill of the
> information in cache.
> Is there a better way'
> Joey
> "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
> news:eesuRMlOFHA.524@.TK2MSFTNGP09.phx.gbl...
>

0 comments:

Post a Comment