Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web application's session ending

Status
Not open for further replies.

clyde11

Programmer
Feb 6, 2006
25
GB
Hello all,
I'm writing an asp.net web application in C#
i would like to invoke some function when the session
ends (e.g, deleting some files from the web server directory) is there any function (like the Page_Load() func. that is being called every time the page is being load) that occires when session ends ?

Best,
P.
 
Quoted from Global.asax
Code:
    void Session_End(object sender, EventArgs e) 
    {
        // Code that runs when a session ends. 
        // Note: The Session_End event is raised only when the sessionstate mode
        // is set to InProc in the Web.config file. If session mode is set to StateServer 
        // or SQLServer, the event is not raised.

    }

You might also want to take a look at
 
Thanks,
but i'm afraid i'm missing something here,
in an asp.net web app. when the user close the IE
window, it's means that that the session ends ?
if so, then can't figure out why do the Session_End()
do not invoked,

Best,
P
 

"when the user close the IE window, it's means that that the session ends ?"


>> No. The server does not know what the client does. The session will end, and the Session_End sub will fire, in some minutes that are specifyied in web.config file.

E.g.

<system.web>
<sessionState timeout="20"/>
</system.web>

Hope this helps.
(PS: the right forum is forum855 : ASP.NET)
 
thanks guys,
really helped !
i was adviced running a windows service that will
do the job, in my case deleting some files in the web srver, files that are created with each session, so deleting them evry 24 hrs. will probably do...

Thanks again
P.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top