Response.Redirect in VS2005 causes Session termination

Last post 09-24-2007 7:10 AM by DavidRhodes. 7 replies.

Sort Posts:

  • Response.Redirect in VS2005 causes Session termination

    08-10-2007, 1:28 PM
    • Loading...
    • StanDav
    • Joined on 12-05-2005, 3:39 PM
    • Posts 14

    I am porting apps from vs2003 to vs2005.

    Found that Response.Redirect is terminating my sessions in vs2005. This was not the case in vs2003. I kind of suspect that the vs2003 IDE is either not set up properly or that there is a deficiency with the vs2005 IDE.

     

    Does anyone have any visibility with this problem.

    Thanks,
    Sdav
  • Re: Response.Redirect in VS2005 causes Session termination

    08-10-2007, 5:19 PM
    • Loading...
    • neomax212000
    • Joined on 05-13-2005, 6:07 PM
    • India
    • Posts 44

    Hi,

     could please send the repro steps so i can reproduce the issue and resolve it .

    Thanks

    Rudra roy

    Rudra Roy
  • Re: Response.Redirect in VS2005 causes Session termination

    08-11-2007, 3:58 PM
    Answer
    • Loading...
    • nufastian
    • Joined on 06-20-2007, 4:20 PM
    • Posts 21
    HI, I am working for about 2 years in VS 2005, and let me asure you that it has no such issue on redirect. Response.Redirect  never do anything with session state. Your code is probably doing something here, can you post it ?
    If this post was helpful, please mark it as an 'Answer'

    MCP - Web-Based Client Development .Net 2.0
    http://beenishsaharkhan.blogspot.com
  • Re: Response.Redirect in VS2005 causes Session termination

    08-13-2007, 3:47 PM
    • Loading...
    • StanDav
    • Joined on 12-05-2005, 3:39 PM
    • Posts 14

    I ported the app in question from vs2003. The conversion process does not set up the vs2005 environment entirely. Additionally, conversion from my impression of the forums, has a habit of dropping modules and misconverting interfaces. In fact, I had to convert the project in question twice, because a module's interface was trashed. I am using the IIS for debugging, and the Response.Redirect will terminate a session, or start a second session, if there is disagreement with the IIS site name. I know that the session was terminated, in this instance.  I am not sufficiently knowledgeable to know how this might have happened, but it could be due to the vs2005 project setup.

    I will attempt to build an app in vs2003 that will exhibit this behavior, and put it up.

     

     

     

    Thanks,
    Sdav
  • Re: Response.Redirect in VS2005 causes Session termination

    08-13-2007, 9:37 PM

    HI,StanDav

    It is due to browser security settings, if you add the web address in trusted sites list it works fine, and session doesn't expire. The alternate way is to add the following code in response header before redirecting the page:

         Response.AddHeader("P3P", "CP=\"CAO PSA OUR\"");
         Response.Redirect("mypage.aspx", false);

     

    Best Regards,
    __________________________________________________
    Sincerely,
    Rex Lin
    Microsoft Online Community Support

    If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
  • Re: Response.Redirect in VS2005 causes Session termination

    08-14-2007, 11:57 AM
    • Loading...
    • StanDav
    • Joined on 12-05-2005, 3:39 PM
    • Posts 14

    Hi Rex,

    I have both vs2003 and vs2005 resident on the same machine (MS says its OK). The VS2003 version of the app works fine on the machine. Thus it cannot be the browser, unless vs2005 makes additional demands. I added the urls to the browser anyway, with no change.

    In the vs2005 environment, I had to change the assembly name slightly, so that it would register(myapp.dll and myapp05.dll), since the projects in both environments have the same name(different locations and web site names).

    I don't know if this is a factor in vs2005, but I am running w2000.

     

     

     

     

    Thanks,
    Sdav
  • Re: Response.Redirect in VS2005 causes Session termination

    08-20-2007, 12:09 PM
    • Loading...
    • StanDav
    • Joined on 12-05-2005, 3:39 PM
    • Posts 14

    ATTN : LIN

    Was that it?  Was that the extent of Community support? 

    What was the recommendation?

     Was my problem insoluble?

     

    Thanks,
    Sdav
  • Re: Response.Redirect in VS2005 causes Session termination

    09-24-2007, 7:10 AM
    I'm experiencing the same problem. It only seems to be happening when using IIS as opposed to VS2005's built in web server and only when doing 'View in browser'. Launching the site with the debugger attached using IIS does not cause any problems and using the built in web server does not cause any problems.
Page 1 of 1 (8 items)
Microsoft Communities
Page view counter