By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,428 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

Get Current logged in users

P: n/a
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

Nov 16 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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.GetNumberOfUsersOnl ine() function will show
the number logged int.

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

"Brendon Bezuidenhout" <ab****@bezfamily.netwrote in message
news:e9****************@TK2MSFTNGP03.phx.gbl...
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

Nov 16 '06 #2

P: n/a
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 '06 #3

P: n/a
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" <Ol*********@IntuiDev.comwrote in message
news:uq**************@TK2MSFTNGP02.phx.gbl...
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 '06 #4

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

http://classicasp.aspfaq.com/general.../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" <abs...@bezfamily.net>
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" <Olaf_NoS...@IntuiDev.comwrote in messagenews:uq**************@TK2MSFTNGP02.phx.gbl. ..
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 '06 #5

P: n/a
Oops! That tag/attribute should belong in web.config... not
global.asax.

On Nov 16, 9:25 am, "jos...@gmail.com" <jos...@gmail.comwrote:
There's a nice writeup here, that talks about three seperate methods to
go about doing this:

http://classicasp.aspfaq.com/general...-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" <abs...@bezfamily.net>
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" <Olaf_NoS...@IntuiDev.comwrote in messagenews:uq**************@TK2MSFTNGP02.phx.gbl. ..
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 '06 #6

P: n/a
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

<jo****@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
There's a nice writeup here, that talks about three seperate methods to
go about doing this:

http://classicasp.aspfaq.com/general.../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" <abs...@bezfamily.net>
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" <Olaf_NoS...@IntuiDev.comwrote in
messagenews:uq**************@TK2MSFTNGP02.phx.gbl ...
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 '06 #7

P: n/a
Hi,

jo****@gmail.com wrote:
There's a nice writeup here, that talks about three seperate methods to
go about doing this:

http://classicasp.aspfaq.com/general.../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
Nov 17 '06 #8

P: n/a
Hi,

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

http://classicasp.aspfaq.com/general.../sessions.html
also, there's another more or less built-in method of counting users. If
you use the membership-provider, check out the GetNumberOfUsersOnline-prop,
i.e.:
lblUserInfo.Text = Membership.GetNumberOfUsersOnline().ToString;

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 17 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.