Session_OnEnd method not firing

A

Andy Kasotia

My Session_OnStart works but Session_OnEnd does not work. Here's the
code...can anyone tell me what's wrong with my code or if anything else
on the server that needs to be changed. The Session_OnStart does create
the folder for me with the SessionID as the folder name but
Session_OnEnd does not delete that folder.

Sub Session_OnStart
Dim fso, f, DirToCreate
'Create a folder to store PDF Files
Set fso = CreateObject("Scripting.FileSystemObject")
DirToCreate = "D:\irater_asp\pdf\" & Session.SessionID
Set f = fso.CreateFolder(DirToCreate)
Set fso = Nothing
Set f = Nothing
End Sub

Sub Session_OnEnd
Dim DirToDelete
Dim fso
DirToDelete = "D:\irater_asp\pdf\" & Session.SessionID
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(DirToDelete)
Set fso = Nothing
End Sub
 
K

Kyle Peterson

Unfortunatly Session_OnEnd is not known to not be reliable. Anyone who has
been working with ASP for years has learned to not to use it for anything..
for the most part

The situation with it has not improved over the years to my knowledge
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top