After response.redirect Session lost the value

In 3.5 framework

After response.redirect(detail.aspx) some how session loose the stored value
If Used server.transfter(detail.aspx) it keeps the value correctly.

Why response.redirect looks the value compate to server.transfer?
Bharat GuruAsked:
Who is Participating?
Bill NolanConnect With a Mentor Owner, Lead Technology ProgrammerCommented:
LOL!  Does it work with worker processes set to 1?

If you are using multiple worker processes I think you may need to use a session service.  There could be a problem with the request going to a different  process than the one that created the session.
Bill NolanOwner, Lead Technology ProgrammerCommented:
Response.Redirect will end the response by default.

Use Response.Redirect("detail.aspx", false);
Bharat GuruAuthor Commented:
even If I used Response.Redirect("detail.aspx", false);   I'm getting same thing some how all session values are empty on new page.

on on onl clock even
   Session("ID") = 43;
   Response.Redirect("detail.aspx", false);

    some how Session("ID")  becames "".
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Bill NolanOwner, Lead Technology ProgrammerCommented:
Look over your debug output.  Is something causing the application to reset?

Other possibilities:

Look over IIS settings, and especially application pools.  Are you using web farm/garden (max. worker processes > 1)?

Check your host name for invalid characters.  Apparently this can interfere with cookies.

do you have EnableSessionState="True" in <@Page... directive?

use Response.Redirect("detail.aspx", false);

Delete cookeis and than try again.
Bharat GuruAuthor Commented:
We are using web garden as 5
Bharat GuruAuthor Commented:
EnableSessionState="True and  web garden as 500 doesn't help
Bharat GuruAuthor Commented:
process set to 1 also doesn't work
everything doesn't work except server.transfer
Bill NolanOwner, Lead Technology ProgrammerCommented:
After you make the IIS change restart the server.
All Courses

From novice to tech pro — start learning today.