I could probably have a boolean field in the database where a user can be
set as logged. This can easily be done in the code-behind. The problem is
how do I "unlogged" the user when the session is timed out?
> I need to implement an option to display on the web page for users
> currently logged in. How do I implement this in ASP.NET (c#).
How are you managing logins...?
> I could probably have a boolean field in the database where a user can be
> set as logged. This can easily be done in the code-behind. The problem is
> how do I "unlogged" the user when the session is timed out?
If you're using inproc sessions, you can write code in the Session_End
event...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Can you show me a code snippet or direct me a tutorial on how to go about
this?
Thanks.
"Mark Rae [MVP]" <ma...@markNOSPAMrae.net> wrote in message
news:ePymupPn...@TK2MSFTNGP05.phx.gbl...
[top-posting corrected]
>>> I need to implement an option to display on the web page for users
>>> currently logged in. How do I implement this in ASP.NET (c#).
>>
>> How are you managing logins...?
>>
>>> I could probably have a boolean field in the database where a user can
>>> be set as logged. This can easily be done in the code-behind. The
>>> problem is how do I "unlogged" the user when the session is timed out?
>>
>> If you're using inproc sessions, you can write code in the Session_End
>> event...
>
> The registered users are authenticated against a datafile. Particulars are
> kept in a a session variable.
OK, so when a user logs out, remove them from the session variable.
And, when a session times out, remove the user from the session variable
through the Session_End code in global.asax.
http://www.google.co.uk/search?sourceid=navclient&hl=en-GB&ie=UTF-8&rlz=1T4GZEZ_en-GBGB252GB252&q=%22ASP%2eNET%22+Session%5fEnd
"Mark Rae [MVP]" <ma...@markNOSPAMrae.net> wrote in message
news:eyXP93Xn...@TK2MSFTNGP04.phx.gbl...
[top-posting corrected again]
> What happens then when the user just closes the browser?
Nothing, as far as the webserver is concerned. That's the nature of the
disconnected architecture of the web.
> How do handle this?
You can't...