Sessions Information

C

Coder

Hello,

I am developing a dating site, What I am trying to do is;

When one of my members logins, should see how many users online, and should
see which users online when searching and listing other users..

I think I should work on "Session" and I must reach all the sessions
informations.. ?

What s the way?

Thanks
 
P

Paul Henderson

I am developing a dating site, What I am trying to do is;
When one of my members logins, should see how many users online, and should
see which users online when searching and listing other users..
I think I should work on "Session" and I must reach all the sessions
informations.. ?

You should not [and cannot easily] access the Session object for other
sessions than the one for the context under which the page is
executing. Instead, you could keep a centralised record of the number
and perhaps names of online users, for example in the Application
object. When a session is started [specifically, when a user signs in],
you can add their name to a list variable such as
Application["CurrentUsers"], which would be accessible from anywhere
you wanted to see the data. When they log off, or the global session
end event is fired, you can remove the relevant user from the list. It
might be more efficient to store whether each user is online in their
database record, and just to keep a count of the total number in
memory.

-- PH
 
J

Jan Hyde

Hello,

I am developing a dating site, What I am trying to do is;

When one of my members logins, should see how many users online, and should
see which users online when searching and listing other users..

I think I should work on "Session" and I must reach all the sessions
informations.. ?

What s the way?

If I understand you, then you should be able to achive what
you want with

Membership.GetNumberOfUsersOnline

Membership.GetAllUsers

Jan Hyde (VB MVP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top