View previous topic :: View next topic |
Author |
Message |
aven -
Joined: 26 Dec 2003 Posts: 12 Location: Huddinge, Stockholm, Sweden
|
Posted: Tue Dec 30, 2003 3:10 pm Post subject: Unable to list session data |
|
|
First look at this example and try to guess its output.
<%
Session.Contents("test") = "just an example"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Session.Contents("second_test") = 5
Response.Write "There are " & Session.Contents.Count & " variables in Session.<br>"
Response.Write(Session("test") & "<br>")
for each name in Session.Contents
Response.Write name & " = " & Session(name) & "<br>"
next
%>
</body>
</html>
Now, look at the resulting output...
Quote: | There are 0 variables in Session.
just an example
|
Why?
I don't know if this have been the case all the time but I suddenly do have problems with saving data in the session object from one page to another. Does anyone know of this behavior before? |
|
Back to top |
|
 |
aven -
Joined: 26 Dec 2003 Posts: 12 Location: Huddinge, Stockholm, Sweden
|
Posted: Tue Dec 30, 2003 3:30 pm Post subject: |
|
|
Here's another example of the same kind
<%
SET temp = Server.CreateObject("ADODB.Recordset")
SET Session.Contents("test") = temp
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Response.Write("There are " & Session.StaticObjects.Count & " objects in Session.<br>")
Response.Write(TypeName(Session("test")) & "<br>")
for each name in Session.StaticObjects
Response.Write(name & " : " & TypeName(Session(name)) & "<br>")
next
%>
</body>
</html>
And this is the resulting output:
Quote: | There are 0 objects in Session.
Recordset |
|
|
Back to top |
|
 |
|