473,791 Members | 3,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session end event fires but it is not executing code

I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance
Nov 17 '05 #1
4 7427
If you are using session mode other then InProce, session_end will not fire.

If you are usnig inproc - then how do u know it's firing if your code is not
being executed?

Also, posting the code would be helpful.

"Sampriti" <su*****@mailci ty.com> wrote in message
news:0f******** *************** *****@phx.gbl.. .
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

Nov 17 '05 #2
how do you know the Session_End event is firing? If your delete code is
correct, and works, and the session_end event is firing, and your delete
code is called in session_end, then there isn't a reason for it not to work

unless, you don't have permission to delete the file? Did you step into it
and verify that the delete code is running?

"Sampriti" <su*****@mailci ty.com> wrote in message
news:0f******** *************** *****@phx.gbl.. .
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

Nov 17 '05 #3
What Console are you trying to write to?

Instead, try logging the beginning of Session_End to a database or
something. Make sure it is executing.

"sampriti" <su*****@mailci ty.com> wrote in message
news:05******** *************** *****@phx.gbl.. .
This is how I know my session end event is firing
1.I have put break point on first line of code in
session_end event.
2.when the event fires the breakpoint which is red
initially turns yellow.
3.When I click stepInto nothing happens and breakpoint
turns red.
Here is my file delete code in session_end event of my
global.asax file
string strSessionDatas etFile = Server.MapPath
("~/SearchXML/"+Session.Sessi onID+".xml");
FileInfo fi = new FileInfo(strSes sionDatasetFile );
if(fi.Exists)
{
// delete the file
try
{
fi.Delete();
}
catch (Exception ex)
{
Console.WriteLi ne(ex.ToString( ));
}

}
-----Original Message-----
If you are using session mode other then InProce,

session_end will not fire.

If you are usnig inproc - then how do u know it's firing

if your code is not
being executed?

Also, posting the code would be helpful.

"Sampriti" <su*****@mailci ty.com> wrote in message
news:0f******* *************** ******@phx.gbl. ..
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

.

Nov 17 '05 #4
Rad
(insufficient) permissions on the file..
"Sampriti" <su*****@mailci ty.com> wrote in message
news:0f******** *************** *****@phx.gbl.. .
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

Nov 17 '05 #5

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

Similar topics

13
7499
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on it, a frontend and a backend. Case 1: If vba code on the frontend updates many rows (360,000) on the backend, a form's timer event (from the frontend) will stop firing until the user gives the form focus. (Note that the update itself always...
3
2120
by: Jeff Smythe | last post by:
I simply want to execute some code once when a new session of my ASP.NET application is started (I'm not using session state for anything else - just writing some data to a database). I thought that I could simply put the code in the Session_Start event procedure in Global.asax.cs, however, the event procedure executes and a new session is created every time any page is requested - not just for the first page requested....
8
1799
by: Paul | last post by:
Hi, In a class i built, i fire an event when a field changes. In a webform that has an instance of the class, the event (from the class) is fired and the code is executed. However, my webpage does not reload (postback) after the event fires. How do i get the webform to postback when the event fires (after the code in the event is done executing)? Thank you, Paul
6
588
by: Patrick Olurotimi Ige | last post by:
I'm tracking usersOnline by adding this code below in my Global.asax file.But i noticed that when a user logs in it keeps adding a new user which thats fine..but when a user logs of it still retains the user(session) for sometime instead of reducing it by one! I'm thinking of maybe i should change something in IIS relating to Session? Any ideas..
5
9131
by: news.microsoft.com | last post by:
Hi everyone, I need some help (may be in the form of some sample code) for the subject question. I have an ASP.NET/C# application. I need to do quite a few tasks when the session ends. I don't want to depend on the session timeout factor since it may end too soon or it may hang around too long. I can't find any event that fires when the browser closes. The Session_End event handler in the Global.asax does not execute until the...
5
548
by: Sean | last post by:
Problem with sessions I have created an application without concern for sessions. As it turns out I think that might be my undoing. What I have: I have an online quiz. I don’t need to know users or save any data. If the application crashes or user exits the program they should simply start again. Pretty basic. All interactions are stored in an array (not much going on to save to a
5
6730
by: news.microsoft.com | last post by:
We are logging many events on our application but cant seem to discover how to determine who the user was in the session end event, as any session storage seems to have disapeared at the point at which the event fires. In essence, I want to log when a users session expires. Any inspiration would be appreciated.
11
2110
by: David Thielen | last post by:
Hi; Is there some kind of session ID variable that I can get in the code behind and that is available in Session_OnEnd() to know what session ended? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
6
1744
by: Marcus | last post by:
I have an ASP.Net 2.0 app that needs to jump out onto another web server running a java server page website (Apache TomCat 4.1.12) that I control. I hate that it needs to do this, but we are using some internet GIS mapping web tool that comes "precanned" with lots of mapping ability and its pages run on JSP. Theasp.net Session_End event is quite important to catch as there is a lot of cleanup that needs to happen in the database relating...
0
10427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10155
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.