Q:

Classic Asp session value lost in Response.Redirect

I have a "login.asp" page where I am setting a session variable.
Session("username") = username

and accessing the value like :
Dim username 
username = Session("username")
response.write(username )

I am also using this value in the same page using "response.write" (i.e. in vbscript). After that, I am redirecting the user to "user.asp". In this page, when I try to access the session value, it returns null. How can I get the session value in the redirected page?
Thanks in Advance.

A:

This code below works:
Setting the username Session Variable
login.asp
<%
Dim username  
username = "auser"

Session("username") = username 
response.redirect("user.asp") 
%>

Getting the username Session Variable
user.asp
<%
Dim username  
username = Session("username") 

response.write("username=" + username ) 
%>

