Get Current logged in users

Discussion in 'ASP .Net' started by Brendon Bezuidenhout, Nov 16, 2006.

  1. Hey all,

    Newbie question I'm afraid: Is there a way to see/tell how many users are
    currently logged into a website at all?

    Thanks
    Brendon
     
    Brendon Bezuidenhout, Nov 16, 2006
    #1
    1. Advertising

  2. It depends upon what you mean by logged in. If you mean casual users who are
    just visiting your site, then you'll need some tool to analyze your log
    files to see that information. If you're using something like the ASP.Net
    Membership system, then the
    System.Web.Security.Membership.GetNumberOfUsersOnline() function will show
    the number logged int.

    --
    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006

    "Brendon Bezuidenhout" <> wrote in message
    news:e9Mt%...
    > Hey all,
    >
    > Newbie question I'm afraid: Is there a way to see/tell how many users are
    > currently logged into a website at all?
    >
    > Thanks
    > Brendon
     
    Mark Fitzpatrick, Nov 16, 2006
    #2
    1. Advertising

  3. Hi,

    Brendon Bezuidenhout wrote:

    > Newbie question I'm afraid: Is there a way to see/tell how many users are
    > currently logged into a website at all?


    you could use the Session_Start and Session_End functions (Global.asax) to
    track who logged on and off. However, since sessions may remain for
    whatever duration has been specified (unless users explicitly log off), the
    expressiveness of the so calculated figure will be doubtful at best.

    Cheers,
    Olaf
    --
    My .02: www.Resources.IntuiDev.com
     
    Olaf Rabbachin, Nov 16, 2006
    #3
  4. Heya Olaf,

    Ermmmmmmm *blank look* - I'm a newbie to ASP.net moving form Win Forms to
    Web Forms lol.... Thanks for the pointers re: Global.aspx... Where/How do I
    set the sessions timeout as such?

    Brendon

    "Olaf Rabbachin" <> wrote in message
    news:...
    > Hi,
    >
    > Brendon Bezuidenhout wrote:
    >
    >> Newbie question I'm afraid: Is there a way to see/tell how many users are
    >> currently logged into a website at all?

    >
    > you could use the Session_Start and Session_End functions (Global.asax) to
    > track who logged on and off. However, since sessions may remain for
    > whatever duration has been specified (unless users explicitly log off),
    > the
    > expressiveness of the so calculated figure will be doubtful at best.
    >
    > Cheers,
    > Olaf
    > --
    > My .02: www.Resources.IntuiDev.com
     
    Brendon Bezuidenhout, Nov 16, 2006
    #4
  5. Brendon Bezuidenhout

    Guest

    There's a nice writeup here, that talks about three seperate methods to
    go about doing this:

    http://classicasp.aspfaq.com/general/how-do-i-count-the-number-of-current-users/sessions.html

    In response to your last question, I believe you can set the timeout
    within your global.asax file. Within the sessionState tag, add an
    attribute such as:
    timeout="60"
    The 60 means that the session would timeout after 60 minutes. I haven't
    done much with session states, so there could be another method to go
    about doing this.


    On Nov 16, 5:28 am, "Brendon Bezuidenhout" <>
    wrote:
    > Heya Olaf,
    >
    > Ermmmmmmm *blank look* - I'm a newbie to ASP.net moving form Win Forms to
    > Web Forms lol.... Thanks for the pointers re: Global.aspx... Where/How do I
    > set the sessions timeout as such?
    >
    > Brendon
    >
    > "Olaf Rabbachin" <> wrote in messagenews:...
    >
    > > Hi,

    >
    > > Brendon Bezuidenhout wrote:

    >
    > >> Newbie question I'm afraid: Is there a way to see/tell how many users are
    > >> currently logged into a website at all?

    >
    > > you could use the Session_Start and Session_End functions (Global.asax) to
    > > track who logged on and off. However, since sessions may remain for
    > > whatever duration has been specified (unless users explicitly log off),
    > > the
    > > expressiveness of the so calculated figure will be doubtful at best.

    >
    > > Cheers,
    > > Olaf
    > > --
    > > My .02:www.Resources.IntuiDev.com
     
    , Nov 16, 2006
    #5
  6. Brendon Bezuidenhout

    Guest

    Oops! That tag/attribute should belong in web.config... not
    global.asax.

    On Nov 16, 9:25 am, "" <> wrote:
    > There's a nice writeup here, that talks about three seperate methods to
    > go about doing this:
    >
    > http://classicasp.aspfaq.com/general/how-do-i-count-the-number-of-cur...
    >
    > In response to your last question, I believe you can set the timeout
    > within your global.asax file. Within the sessionState tag, add an
    > attribute such as:
    > timeout="60"
    > The 60 means that the session would timeout after 60 minutes. I haven't
    > done much with session states, so there could be another method to go
    > about doing this.
    >
    > On Nov 16, 5:28 am, "Brendon Bezuidenhout" <>
    > wrote:
    >
    > > Heya Olaf,

    >
    > > Ermmmmmmm *blank look* - I'm a newbie to ASP.net moving form Win Forms to
    > > Web Forms lol.... Thanks for the pointers re: Global.aspx... Where/How do I
    > > set the sessions timeout as such?

    >
    > > Brendon

    >
    > > "Olaf Rabbachin" <> wrote in messagenews:...

    >
    > > > Hi,

    >
    > > > Brendon Bezuidenhout wrote:

    >
    > > >> Newbie question I'm afraid: Is there a way to see/tell how many users are
    > > >> currently logged into a website at all?

    >
    > > > you could use the Session_Start and Session_End functions (Global.asax) to
    > > > track who logged on and off. However, since sessions may remain for
    > > > whatever duration has been specified (unless users explicitly log off),
    > > > the
    > > > expressiveness of the so calculated figure will be doubtful at best.

    >
    > > > Cheers,
    > > > Olaf
    > > > --
    > > > My .02:www.Resources.IntuiDev.com
     
    , Nov 16, 2006
    #6
  7. Thanks a million for that Josh - Makes things a little clearer for me :)

    Not as convoluted as the security framework I have to deal with at work
    thankfully lol

    <> wrote in message
    news:...
    > There's a nice writeup here, that talks about three seperate methods to
    > go about doing this:
    >
    > http://classicasp.aspfaq.com/general/how-do-i-count-the-number-of-current-users/sessions.html
    >
    > In response to your last question, I believe you can set the timeout
    > within your global.asax file. Within the sessionState tag, add an
    > attribute such as:
    > timeout="60"
    > The 60 means that the session would timeout after 60 minutes. I haven't
    > done much with session states, so there could be another method to go
    > about doing this.
    >
    >
    > On Nov 16, 5:28 am, "Brendon Bezuidenhout" <>
    > wrote:
    >> Heya Olaf,
    >>
    >> Ermmmmmmm *blank look* - I'm a newbie to ASP.net moving form Win Forms to
    >> Web Forms lol.... Thanks for the pointers re: Global.aspx... Where/How do
    >> I
    >> set the sessions timeout as such?
    >>
    >> Brendon
    >>
    >> "Olaf Rabbachin" <> wrote in
    >> messagenews:...
    >>
    >> > Hi,

    >>
    >> > Brendon Bezuidenhout wrote:

    >>
    >> >> Newbie question I'm afraid: Is there a way to see/tell how many users
    >> >> are
    >> >> currently logged into a website at all?

    >>
    >> > you could use the Session_Start and Session_End functions (Global.asax)
    >> > to
    >> > track who logged on and off. However, since sessions may remain for
    >> > whatever duration has been specified (unless users explicitly log off),
    >> > the
    >> > expressiveness of the so calculated figure will be doubtful at best.

    >>
    >> > Cheers,
    >> > Olaf
    >> > --
    >> > My .02:www.Resources.IntuiDev.com

    >
     
    Brendon Bezuidenhout, Nov 16, 2006
    #7
  8. Hi,

    wrote:

    > There's a nice writeup here, that talks about three seperate methods to
    > go about doing this:
    >
    > http://classicasp.aspfaq.com/general/how-do-i-count-the-number-of-current-users/sessions.html


    great link - thanks!

    > In response to your last question, I believe you can set the timeout
    > within your global.asax file. Within the sessionState tag, add an
    > attribute such as:
    > timeout="60"
    > The 60 means that the session would timeout after 60 minutes.


    I.e.:
    ....
    <system.web>
    ...
    <sessionState mode="InProc" timeout="20"/>
    ...
    </system.web>

    > I haven't done much with session states, so there could be another method
    > to go about doing this.


    You could also set this within your website's IIS-settings (see the State
    Managment strip). And I guess (!) you might do so in the machine.config
    file, but I never tried that.

    Cheers,
    Olaf
    --
    My .02: www.Resources.IntuiDev.com
     
    Olaf Rabbachin, Nov 17, 2006
    #8
  9. Olaf Rabbachin, Nov 17, 2006
    #9
    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. John Dalberg
    Replies:
    6
    Views:
    21,156
    John Dalberg
    Apr 18, 2005
  2. keithb
    Replies:
    0
    Views:
    658
    keithb
    Feb 16, 2006
  3. iclinux
    Replies:
    0
    Views:
    396
    iclinux
    Mar 14, 2006
  4. Replies:
    1
    Views:
    972
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  5. Imran Aziz

    Get the current logged in user name

    Imran Aziz, Aug 2, 2005, in forum: ASP .Net Security
    Replies:
    8
    Views:
    236
Loading...

Share This Page