Session end event fires but it is not executing code

Discussion in 'ASP .Net' started by Sampriti, Jun 26, 2003.

  1. Sampriti

    Sampriti Guest

    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
    Sampriti, Jun 26, 2003
    #1
    1. Advertising

  2. Sampriti

    Marina Guest

    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" <> wrote in message
    news:0f5001c33c06$b1d85140$...
    > 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
    Marina, Jun 26, 2003
    #2
    1. Advertising

  3. Sampriti

    George Durzi Guest

    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" <> wrote in message
    news:0f5001c33c06$b1d85140$...
    > 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
    George Durzi, Jun 26, 2003
    #3
  4. Sampriti

    Marina Guest

    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" <> wrote in message
    news:05ba01c33c22$aef3be30$...
    > 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 strSessionDatasetFile = Server.MapPath
    > ("~/SearchXML/"+Session.SessionID+".xml");
    > FileInfo fi = new FileInfo(strSessionDatasetFile);
    > if(fi.Exists)
    > {
    > // delete the file
    > try
    > {
    > fi.Delete();
    > }
    > catch (Exception ex)
    > {
    > Console.WriteLine(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" <> wrote in message
    > >news:0f5001c33c06$b1d85140$...
    > >> 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

    > >
    > >
    > >.
    > >
    Marina, Jun 26, 2003
    #4
  5. Sampriti

    Rad Guest

    (insufficient) permissions on the file..


    "Sampriti" <> wrote in message
    news:0f5001c33c06$b1d85140$...
    > 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
    Rad, Jun 26, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    815
    Purvi T
    Oct 19, 2004
  2. =?Utf-8?B?Um9iIFBlbm5lcg==?=

    Asp.Net click event fires on 2000 but not 2003

    =?Utf-8?B?Um9iIFBlbm5lcg==?=, Oct 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    313
    =?Utf-8?B?SGFyaSBOYWly?=
    Oct 18, 2004
  3. Jason Doucette
    Replies:
    27
    Views:
    754
    Jason Doucette
    Jul 1, 2007
  4. Replies:
    3
    Views:
    980
  5. boole
    Replies:
    3
    Views:
    234
    Anthony Jones
    Feb 17, 2008
Loading...

Share This Page