sgadson
Posts: 45
|
Posted: 09/02/2004, 7:35 PM |
|
Using: vb.net; sql
I would like to be able to track when a user is online. I have a field in my Users table named: Online (int)
When a user loggs in I would like to set this value to 1. When the user loggs out or if their scession times out I would like to set this value to 0.
Can someone give me the code to do this?
FYI - I saw a similar post on the old forum but the solution was not given in vb.net.
_________________
Shawn |
|
|
Benjamin Krajmalnik
|
Posted: 09/02/2004, 9:03 PM |
|
You can write code in the login and logout functions to set or clear the
flag.
However, if there is a session timeout it will not work.
In order to check this, I would do it slightly differently.
I woul use a connections table which has the username and the time they
logged in.
Now, every time a page is accessed, you have to refresh the "last connected"
time for the specific user and run a query which would delete all cnnections
older than your session timeout variable.
I think this will yield about as accurate a result as you will get.
"sgadson" <sgadson@forum.codecharge> wrote in message
news:84137d879de252@news.codecharge.com...
> Using: vb.net; sql
>
> I would like to be able to track when a user is online. I have a field in
my
> Users table named: Online (int)
>
> When a user loggs in I would like to set this value to 1. When the user
loggs
> out or if their scession times out I would like to set this value to 0.
>
> Can someone give me the code to do this?
>
> FYI - I saw a similar post on the old forum but the solution was not given
in
> vb.net.
> _________________
> Shawn
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
sgadson
Posts: 45
|
Posted: 09/04/2004, 2:11 PM |
|
Does anyone have a code example to achieve this?
_________________
Shawn |
|
|
|