After response.redirect Session lost the value

In asp.net 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.
0
 
Bill NolanOwner, Lead Technology ProgrammerCommented:
Response.Redirect will end the response by default.

Use Response.Redirect("detail.aspx", false);
0
 
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.


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

Detail.vb
----------
Load()
    some how Session("ID")  becames "".
0
Never miss a deadline with monday.com

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.
0
 
eridanixCommented:
Hi,

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

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


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

From novice to tech pro — start learning today.