is it possible to know how many users logged in to my website currently
It all depands on your definition of a "logged in user"?
When using a membership provider, you can use the Membership.GetNumberOfUsersOnline()
method. But then you need to inderstand aht the definition of a logged in user in the membership class is:
Note that the LastAvtivityDate is NOT updated when a user logs out, so the user will still be considered online for some time, although he logged out...
membership is different from application variable...
really
abhiram_m
is it possible to do that in application variable to know how many members are online ?
I already said that you first need to define what you consider an online user. Next you can think on where and how lkep track of that. You're doig tings the wrong way. you already have chosen the appllication object without defining what an online user is....
abhiram_m
Member
122 Points
67 Posts
how many members are logged in now?
Mar 01, 2012 07:58 AM|LINK
hi
is it possible to know how many users logged in to my website currently
using application variable?
usman400
Contributor
3503 Points
721 Posts
Re: how many members are logged in now?
Mar 01, 2012 08:00 AM|LINK
usman400
Contributor
3503 Points
721 Posts
Re: how many members are logged in now?
Mar 01, 2012 08:06 AM|LINK
also look at following link to get Guests and Members count
http://www.codeproject.com/Articles/29792/Online-active-users-counter-in-ASP-NET
hans_v
All-Star
35986 Points
6550 Posts
Re: how many members are logged in now?
Mar 01, 2012 08:55 AM|LINK
It all depands on your definition of a "logged in user"?
When using a membership provider, you can use the Membership.GetNumberOfUsersOnline() method. But then you need to inderstand aht the definition of a logged in user in the membership class is:
"A user is considered online if the current date and time minus the UserIsOnlineTimeWindow property value is earlier than the LastActivityDate for the user."
http://msdn.microsoft.com/en-us/library/system.web.security.membershipuser.isonline.aspx
Note that the LastAvtivityDate is NOT updated when a user logs out, so the user will still be considered online for some time, although he logged out...
abhiram_m
Member
122 Points
67 Posts
Re: how many members are logged in now?
Mar 01, 2012 09:03 AM|LINK
membership is different from application variable...is it possible to do that in application variable to know how many members are online ?
hans_v
All-Star
35986 Points
6550 Posts
Re: how many members are logged in now?
Mar 01, 2012 09:48 AM|LINK
really
I already said that you first need to define what you consider an online user. Next you can think on where and how lkep track of that. You're doig tings the wrong way. you already have chosen the appllication object without defining what an online user is....