473,385 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Session_OnEnd method not firing

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

*** Sent via Developersdex http://www.developersdex.com ***
Dec 8 '05 #1
1 2119
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
"Andy Kasotia" <ak******@guideone.com> wrote in message
news:e1**************@TK2MSFTNGP15.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***

Dec 8 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tom Bates | last post by:
I can successfully delete files using fso.DeleteFile when in an ASP script. But in Session_OnEnd, where I'd *really* like to clean up files, it appears that DeleteFile doesn't work. I've tried...
3
by: cab | last post by:
i have the following code in the "Sub Session_OnEnd" routine that does not seem to run..... Sub Session_OnEnd strConnect = "Driver={SQL Server};Server=SERVER;Database=database; User...
3
by: Phil Lamey | last post by:
Hi All, I have the following code but for some reason I cannot get the Session_OnEnd event to fire. I am trying to limit the amount of connections a browser session can have. Where the...
11
by: andrea azzini | last post by:
I've got an ASP3 (IIS6) site, in which some scripts need to generate temporary files in order to work. Now, the fact is: I would like those temporary files to be deleted when a user's session ends...
4
by: anand | last post by:
In my website i want to trace the event when user log off from the site by closing the explorer so i am unable to run any server side program at that time and my session_onend event also not...
6
by: rob | last post by:
I've got code in my session_onend event that clears out database entries based on the sessionID that just expired. The code works in the development environment, but doesn't work in the...
6
by: Martin | last post by:
Hi, Since I went ASP.NET with my global.asa (making it a global.asax) the application events are called just fine as well as the Session_OnStart event but the Session_OnEnd event is not. What is...
2
by: Raghu Raman | last post by:
Hi , am storing the session id in my database when the user signs in.The session_on start is firing nice & am doing my DB operations there & quite working good. But when the user closes the...
4
by: Chris Ashley | last post by:
There seem to be isolated occurences of Session_OnEnd not firing in my app. This is problematic because some clean up of resources happens here. I know the Session events were unreliable in classic...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.