Determine users currently logged in

Discussion in 'ASP .Net' started by Benedictum, Apr 13, 2008.

  1. Benedictum

    Benedictum Guest

    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#).

    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?
    Benedictum, Apr 13, 2008
    #1
    1. Advertising

  2. Benedictum

    Benedictum Guest

    The registered users are authenticated against a datafile. Particulars are
    kept in a a seesion var.

    Can you show me a code snippet or direct me a tutorial on how to go about
    this?
    Thanks.

    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "Benedictum" <> wrote in message
    > news:...
    >
    >> 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
    Benedictum, Apr 13, 2008
    #2
    1. Advertising

  3. Benedictum

    Benedictum Guest

    What happens then when the user just closes the browser? How do handle this?

    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "Benedictum" <> wrote in message
    > news:...
    >
    > [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?sour...4GZEZ_en-GBGB252GB252&q="ASP.NET" Session_End
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    Benedictum, Apr 17, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZXN3YW5zb24=?=

    getting currently logged in user asp.net c sharp class

    =?Utf-8?B?ZXN3YW5zb24=?=, Feb 28, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    5,758
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 28, 2006
  2. james
    Replies:
    2
    Views:
    755
    William Brogden
    Apr 8, 2004
  3. iclinux
    Replies:
    0
    Views:
    378
    iclinux
    Mar 14, 2006
  4. gover

    Currently Logged on users

    gover, Jun 8, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    318
    =?Utf-8?B?U2l2YSBN?=
    Jun 8, 2007
  5. Marcin Zmyslowski

    Currently logged users

    Marcin Zmyslowski, Mar 3, 2005, in forum: ASP General
    Replies:
    0
    Views:
    131
    Marcin Zmyslowski
    Mar 3, 2005
Loading...

Share This Page