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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session_OnEnd() not working

Status
Not open for further replies.

TerryDad2

Programmer
Jul 10, 2002
29
US
I want to delete a file created by a session when the session ends. I am unable to figure out why the file is not deleted. The session_onstart works fine. Below is the code. Any suggestions?

<%@ Import Namespace=&quot;System&quot; %>
<%@ Import Namespace=&quot;System.IO&quot;%>
<script runat=&quot;server&quot;>
Sub Session_OnStart()
'this stuff removed
end sub
Sub Session_OnEnd()
Dim fi As FileInfo
fi = New FileInfo(Session(&quot;DownloadFilePath&quot;))
if fi.exists then
fi.Delete()
end if
end Sub
</script>
 
Have you tried setting stepping through your session_onEnd code by either:
a) setting your session timeout to a low number so your session will expire and you can step through the code
b) call a session.abandon and step through the onEnd code
?

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top