|
-
Sep 19th, 2002, 03:26 PM
#1
Thread Starter
Member
User online?
I am going to try to set my web page up like an old BBS I ran in the mid 90's. On feature it had, that I have seen on other sites (including vbforums) is it would show a list of users logged in.
How could I implement this?
My ideas:
When a user logs on, have a boolean field in the DB record for that user turn on.
Problems- what if they use a cookie that doesn't expire... will they alway be "online"
- how do I turn them "offline" if they don't click on a logout button.... or is there a On_ticket_expired_event?
Any ideas?
-
Sep 20th, 2002, 08:32 AM
#2
best way would be to create a collection or array and store the user name and their session id into the collection. You can check on session closing to remove that user from the colelction in the situation they dont log off properly. How many people do you know of that actually log off correctly?..
-
Sep 20th, 2002, 09:35 AM
#3
Thread Starter
Member
Sorry to sound ignorant, but how do I determine session ID... I didn't realy even realize there was an actual "session"...
I don't know if this makes a difference but i'm using Form based authentication.
-
Sep 20th, 2002, 10:57 AM
#4
Lively Member
I would be intrested in hearing how you solve this problem. All I can think is maybe there is something in IIS that can help you with this task.
"All those who wonder are not lost" -j.r.r tolkien
-
Sep 20th, 2002, 11:03 AM
#5
it is something like Session.SessionId
or something like that.
-
Sep 20th, 2002, 03:48 PM
#6
Addicted Member
if it was me I would log the user's entry onto the webpage by collecting the request info when the open the page, and when they leave the page:
TextBox1.Text += ("\nUser Host:" + Request.UserHostAddress);
TextBox1.Text += ("\nUser Host Name:" + Request.UserHostName);
TextBox1.Text += ("\nLogin Time:" + System.DateTime.Now.ToString("dd/MM/yy"));
Then compare the two times ( I guess minutes rather than days would be more helpful!) to get the amount of time spent on each page. You could send the data up to your sql server db everytime there is a change...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|