scripter73
Programmer
Hi,
I'm trying to change a session variable value to a local variable on my script (Page1.asp),
and then access that changed session variable on another page (Page2.asp).
Currently, I have the GLOBAL.ASA file on my website's root directory.
The GLOBAL.ASA looks like the following:
<script language="Vbscript" Runat=Server>
Sub Session_OnStart
Session("ufilename" = "initial filename"
End Sub
</script>
PAGE1.ASP Script:
<% Response.Buffer = true
userfile = "file123"
%>
<html>...
<body>
<%
'modify existing session variable
Session("ufilename" = userfile
%>
<% Response.Clear
Response.Redirect "Page2.ASP"
%>
</body>
</html>
PAGE2.ASP Script:
<html>...
<body>
The user selected filename is <%=Session("ufilename"%>
</body>
</html>
Browser output is as follows:
The user selected initial filename
I want it to say: The user selected file123
It almost seems like the session var "ufilename" isn't getting updated in Page1.ASP, but if
I do a screen output, it is.
Please let me know where I'm going wrong. Also, how do I make sure my cookies are enabled?
I'm on an NT workstation and I tried to find the setting in Tools / Internet Options on my
browser, but couldn't see it.
Thanks in advance,
scripter73
I'm trying to change a session variable value to a local variable on my script (Page1.asp),
and then access that changed session variable on another page (Page2.asp).
Currently, I have the GLOBAL.ASA file on my website's root directory.
The GLOBAL.ASA looks like the following:
<script language="Vbscript" Runat=Server>
Sub Session_OnStart
Session("ufilename" = "initial filename"
End Sub
</script>
PAGE1.ASP Script:
<% Response.Buffer = true
userfile = "file123"
%>
<html>...
<body>
<%
'modify existing session variable
Session("ufilename" = userfile
%>
<% Response.Clear
Response.Redirect "Page2.ASP"
%>
</body>
</html>
PAGE2.ASP Script:
<html>...
<body>
The user selected filename is <%=Session("ufilename"%>
</body>
</html>
Browser output is as follows:
The user selected initial filename
I want it to say: The user selected file123
It almost seems like the session var "ufilename" isn't getting updated in Page1.ASP, but if
I do a screen output, it is.
Please let me know where I'm going wrong. Also, how do I make sure my cookies are enabled?
I'm on an NT workstation and I tried to find the setting in Tools / Internet Options on my
browser, but couldn't see it.
Thanks in advance,
scripter73