Session Object Clear-up

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I saved Socket Objects in Session to enhance the performance in my ASP.NET app. I have two questions.

1) Does ASP.NET Logon expire the same moment as Session Expire? I use Form Authentication in my ASP.NET Application.

2) I want to Close/Shutdown all socket objects at Session_End() in Global.asax, because I think the ASP.NET may not close it properly. The question is: How could I know if a session object type is Socket? I may use more than one socket, and I could not know how many sockets I used in Session_End() subroutine.

Thanks.
 
Hi,

1) They are separate from each other. Session has its own timeout setting
and Forms Authentication has its own. You can tweak them to be as close each
other as possible and try to expire the other when other ends (you could
also check in global.asax for conditions when one has expired)

2) Perhaps you should store sockets in a custom collection or something that
you store into certain location. Then you could iterate through the
collection, and therefore always iterate through all sockets (just wondering
if they exist anymore when Session_End is called).

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

I saved Socket Objects in Session to enhance the performance in my ASP.NET
app. I have two questions.

1) Does ASP.NET Logon expire the same moment as Session Expire? I use Form
Authentication in my ASP.NET Application.

2) I want to Close/Shutdown all socket objects at Session_End() in
Global.asax, because I think the ASP.NET may not close it properly. The
question is: How could I know if a session object type is Socket? I may use
more than one socket, and I could not know how many sockets I used in
Session_End() subroutine.

Thanks.
 
Back
Top