469,579 Members | 1,098 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

DeleteFile doesn't work in Session_OnEnd???

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 every
combination I could think of. I've verified the filespecs I'm using by
logging to a session log file.

BTW, I found out the hard way that I can't reference
Request.ServerVariables("APPL_PHYSICAL_PATH") from within
Session_OnEnd. I had to copy that to Session("AppPath") to keep it
around for the OnEnd event. Without that, ASP just bails out of OnEnd,
ignoring the remainder of the subroutine.

I need to clean up temporary output files when a session ends.

Any suggestions?

TIA
Tom
Jul 19 '05 #1
3 2886
that;s the problem by design etc of session_onEnd.

There are lots of articles on that but, in the end, it won;t work.

"Tom Bates" <no******@email.me> wrote in message
news:tj********************************@4ax.com...
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 every
combination I could think of. I've verified the filespecs I'm using by
logging to a session log file.

BTW, I found out the hard way that I can't reference
Request.ServerVariables("APPL_PHYSICAL_PATH") from within
Session_OnEnd. I had to copy that to Session("AppPath") to keep it
around for the OnEnd event. Without that, ASP just bails out of OnEnd,
ignoring the remainder of the subroutine.

I need to clean up temporary output files when a session ends.

Any suggestions?

TIA
Tom

Jul 19 '05 #2
"Tom Bates" <no******@email.me> wrote in message
news:tj********************************@4ax.com...
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 every
combination I could think of. I've verified the filespecs I'm using by
logging to a session log file.
This might be caused by security problems.

Session_OnEnd runs under iwam_ and not under iusr_ or the user that logged
in (if anonymous loggin is not used)

--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

BTW, I found out the hard way that I can't reference
Request.ServerVariables("APPL_PHYSICAL_PATH") from within ServerVariables are kept between browser and server. At Session_OnEnd there
is no browser :)
Session_OnEnd. I had to copy that to Session("AppPath") to keep it
around for the OnEnd event. Without that, ASP just bails out of OnEnd,
ignoring the remainder of the subroutine.

I need to clean up temporary output files when a session ends.

Any suggestions?

TIA
Tom


Jul 19 '05 #3
WooHoo! That's It!

I didn't realize that the Session_OnEnd ran under a different user ID.
I added IWAM_<node> permissions and that took care of it.

Thanks *very* much, Egbert, for the help. My hair can now start to
grow back in. :-)

Tom

On Sun, 7 Sep 2003 08:51:21 +0200, "Egbert Nierop \(MVP for IIS\)"
<eg***********@nospam.com> wrote:
"Tom Bates" <no******@email.me> wrote in message
news:tj********************************@4ax.com.. .
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 every
combination I could think of. I've verified the filespecs I'm using by
logging to a session log file.


This might be caused by security problems.

Session_OnEnd runs under iwam_ and not under iusr_ or the user that logged
in (if anonymous loggin is not used)


Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by cab | last post: by
11 posts views Thread by andrea azzini | last post: by
4 posts views Thread by rbt | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.