Welcome to WebmasterWorld Guest from 54.160.221.82

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Session Content

problems with session contents

     

shibonki

10:53 am on Feb 17, 2003 (gmt 0)

Inactive Member
Account Expired

 
 


i am a newbee on web development.

most simple application:
have an asp with which a user can login with username and password.

username and password are used to retrieve a record from a msaccess database.
when not ok, login screen re-displayed.
no problem so far.
if ok, the i want to display the data from the database on a welcome screen, which is a different asp.

after accessing the database, i store the required data as
<% Session("Field1")=Field1 %>
<% Session("Field2")=Filed2 %>
etc.

then i redirect to welcome.asp

display of the username and password is OK
but displaying Field1 and Field 2 does not work.
sometimes just blanks
sometimes error Object not valid any longer.

I tried to use Session.Content(1) but that does not help.

i don't have a global.asa file. (tried that, but it doesnot solve anything)
please help

11:00 am on Feb 17, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 25, 2002
posts:872
votes: 0


If you are putting data from the database straight into the session, try doing it like this;

<%
Session("Field1")=Field1.value
Session("Field2")=Filed2.value
%>

That way you avoid issues about *what* exactly you are putting into session, as often "Field" may decide to store the field object rather than the field value, this way if there are errors while storing data you see the the problems at this point rather than later when you try to use them.

- Tony