How to know which users are online?
Hi,
I've got a website project and I use my own login security and save the user and other info in session variables. Is there any way to know when they are online and offline by their user name I have in a session variable? Or do I need to use another method such as the asp.net user security?
I do know with the asp.net security I can check if a user is authenticated.
Thanks,
Warren
Re: How to know which users are online?
Quote:
Originally Posted by
WarrenW
Hi,
I've got a website project and I use my own login security and save the user and other info in session variables. Is there any way to know when they are online and offline by their user name I have in a session variable? Or do I need to use another method such as the asp.net user security?
I do know with the asp.net security I can check if a user is authenticated.
Thanks,
Warren
I think you may be able to do so by changing your SessionState to SQL Server Mode.
More info here: http://msdn.microsoft.com/en-us/library/ms972429.aspx
Re: How to know which users are online?
If you're using asp.net built-in membership , you can use this function :
Code:
System.Web.Security.Membership.GetUser().IsOnline
(and you can use overloaded function that takes specific username) .
Have a look at this property which let you specify number of minutes considered user is online:
Code:
System.Web.Security.Membership.UserIsOnlineTimeWindow
Re: How to know which users are online?
Quote:
Originally Posted by
WarrenW
Or do I need to use another method such as the asp.net user security?
Personally, this would always be my recommendation. Why re-invent the wheel when you can just as easily use something that a lot of clever people have spent a lot of time getting right?
Gary
Re: How to know which users are online?
I didn't think about it until after I made the post. I haven't fully written the current login security so switching over to the asp.net security will not be hard at all.
Btw, do you know if I can create my own login page in my own style? So far for other sites i have dropped in the login control which is kind of ugly!
Thanks,
Warren
Re: How to know which users are online?
Hello,
The Template of the Login Control is fully configurable, so you can make it look and feel however you want it to.
http://msdn.microsoft.com/en-us/library/ms178339.aspx
Gary