Tracking user logins with Session_End or other

R

Ron J

I would like to keep track of users when they are 'on'. On Session_Start I
can write a DB record about them, but there does not seem to be session
variable information during the Session_end event which I could use to
update the record that they are logged out. This would also be nice to limit
multiple logins.

Is there a preferred way to track users login / logout /session time and
multiple logins ?

TIA
 
R

Ron J

Nice. Thanks.
What if I want to store session 'out of process' on the SQL server or State
Server?

Thanks
 
R

Ron J

Mark,
Fair enough. I'm trying to access inproc Session vars in Session_end but the
the current.Session is already null. I'm seeing some articles that say
AcquireRequestState must fire first, but not sure how to do this. Basically,
I have no access to session variable in the Session_end event. How can I
access them ?

thanks

Mark Rae said:
[top-posting corrected]
What if I want to store session 'out of process' on the SQL server or
State Server?

Session_End won't fire...
 
R

Ron J

Ok, solved it. I was using something like
System.Web.HttpContext.Current.Session("name") (since there is no web
request)
This is not available in Session_End, but just
Session["name"] is.

Thanks



Ron J said:
Mark,
Fair enough. I'm trying to access inproc Session vars in Session_end but
the the current.Session is already null. I'm seeing some articles that say
AcquireRequestState must fire first, but not sure how to do this.
Basically, I have no access to session variable in the Session_end event.
How can I access them ?

thanks

Mark Rae said:
[top-posting corrected]
Session_End fires only when using inproc sessions.
What if I want to store session 'out of process' on the SQL server or
State Server?

Session_End won't fire...
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top