Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Get Current logged in users

Reply
Thread Tools

Get Current logged in users

 
 
Brendon Bezuidenhout
Guest
Posts: n/a
 
      11-16-2006
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

 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      11-16-2006
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" <(E-Mail Removed)> wrote in message
news:e9Mt%(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Olaf Rabbachin
Guest
Posts: n/a
 
      11-16-2006
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
 
Reply With Quote
 
Brendon Bezuidenhout
Guest
Posts: n/a
 
      11-16-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
joshie@gmail.com
Guest
Posts: n/a
 
      11-16-2006
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" <(E-Mail Removed)>
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" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed). ..
>
> > 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


 
Reply With Quote
 
joshie@gmail.com
Guest
Posts: n/a
 
      11-16-2006
Oops! That tag/attribute should belong in web.config... not
global.asax.

On Nov 16, 9:25 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> 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" <(E-Mail Removed)>
> 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" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed). ..

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


 
Reply With Quote
 
Brendon Bezuidenhout
Guest
Posts: n/a
 
      11-16-2006
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

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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" <(E-Mail Removed)>
> 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" <(E-Mail Removed)> wrote in
>> messagenews:(E-Mail Removed). ..
>>
>> > 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

>


 
Reply With Quote
 
Olaf Rabbachin
Guest
Posts: n/a
 
      11-17-2006
Hi,

http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
Olaf Rabbachin
Guest
Posts: n/a
 
      11-17-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serious issue: parts of my page render as not logged in, parts as logged in. Help! pcloches@gmail.com ASP .Net 1 04-12-2007 12:50 AM
LoginView does not show a logged in user as being logged in keithb ASP .Net 0 02-16-2006 05:20 PM
How can I get the current logged user information Shaminda Illangantilaka ASP .Net Security 2 01-25-2006 11:15 AM
Get the current logged in user name Imran Aziz ASP .Net Security 8 08-29-2005 03:54 AM
How to get current logged in Windows username? John Dalberg ASP .Net 6 04-18-2005 06:15 PM



Advertisments