Results 1 to 6 of 6

Thread: User online?

  1. #1

    Thread Starter
    Member otherones's Avatar
    Join Date
    Jun 2002
    Location
    Milk Factory
    Posts
    59

    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?
    CSC

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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?..
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Member otherones's Avatar
    Join Date
    Jun 2002
    Location
    Milk Factory
    Posts
    59
    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.
    CSC

  4. #4
    Lively Member
    Join Date
    Aug 2002
    Location
    outerspace
    Posts
    126
    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

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    it is something like Session.SessionId

    or something like that.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183
    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
  •  



Click Here to Expand Forum to Full Width