Selective Sessions

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Is there a way to only create sessions for specific users? I already have
the user logging in and only want to use sessions for the few administrators
that log in. My concern is that asp.net will just create a session for each
person that comes in. Maybe I can intercept this behavior in the global
asax and tell session to only exist for certain users.

Thanks,

Mike
 
No you can't do that. But why are you so concerned about sessions being
created for each user?
 
I may have 1000+ clients browsing the site, and I only need to store session
data for administrators. It seems like a waste to have the app creating
1000+ null sessions. I thought maybe I could place some code in
Session_Start that checks to see if a user is logged in and is a member of
administrators and if not abort the creation of session. Another approach
may be to create the session when the user logges in and abort all session
on starts...

Mike
 
They are not going to be space consuming if you don't actually store
anything in them.

Aborting the session won't solve it, as a new one will start on the next
request. You will be doing more work killing and starting sessions.

Again, if you don't store anything in 99% of the sessions, then they won't
really be taking up space, so I guess I don't really see a problem here.
 
I have been reading reading reading and I think my fear of sessions goes way
back to the ASP days, I see some useful things I can do with session for
each active user. Thnaks for the wakeup call.

Mike
 
Back
Top