View Single Post
  #3 (permalink)  
Old 02-26-03, 23:22
hktang hktang is offline
Registered User
 
Join Date: Nov 2002
Location: Singapore
Posts: 17
Hi Andrew,

I have done a very simple test.

Page 1:
a simply link to page 2
<a href=page2.asp>go</a>

Page 2:
assign a session variable and redirect immediately to page 3
<%
session("member") = 1
response.redirect "page3.asp"
%>

Page 3:
simply write out the session variable value
<%
response.write session("member")
%>


Yes, it does shows the value stored in the session... nothing is lost....

By the way, I have also set the response.buffer to true... and still the value stored in the session lost after redirecting to the second page.

Regards,
Tang


Quote:
Originally posted by Bunce
You can't redirect in the same page as you set the session like that.

The page needs to 'complete' before it actually sets the session variable, and as you are redirecting it hasn't yet completely sent all the session details to the users browser.

At least , I think that's the problem :=)

You might try setting:
response.buffer = true at the top of the page, or setting the session varible in "Page 1" AFTER you redirect..

Hope this helps..

Cheers,
Andrew
Reply With Quote