keeping sessions alive throughout
From: Eric Throckmorton (ethrockmorton@neo.rr.com)
Date: 10/02/02
- Next message: Patrick C. Cole: "RE: Forms Authentication and SSL"
- Previous message: Kipp Hawley: "Re: What is the possible cause of this error message?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Eric Throckmorton" <ethrockmorton@neo.rr.com> Date: Wed, 2 Oct 2002 12:37:41 -0400
Hello,
I am using sessions in my login.
I have five of them and some are being used throughout the website.
They are all called from the users table as an integer and stored in a
session.
as the navigation carries on, the sessions start timing out. One in
particular (the userID session), times out the fastest.
It is called on the header.ascx (which is at the top of every page.
I have this in my web.config file:
<system.web>
<sessionState mode="InProc" cookieless="false" timeout="480" />
</system.web>
the 480 minutes being 8 hrs. however, i get time out quickly.
the error says: Object not set to the reference of an object. and is
pointing to the header.ascx script where it is calling the username form a
session.
i put the following in the header:
Sub Page_Load(Src As Object, e As EventArgs)
If not IsPostBack then
dim connection as new SqlConnection(
"server=000;UID=000;password=000;Database=000" )
connection.Open ()
dim sql as string = "getfirstname " & Session("userid").ToString()
dim command as new SqlCommand (sql, connection)
dim dr as SQlDataReader = command.ExecuteReader()
dr.Read()
Label1.Text = dr("fname").ToString()
connection.Close()
Else
Label1.Text = "Session Ended"
End If
End Sub
that cut down on the errors and now where the first name goes it labels
session ended until a page is switched or it times out.
What can i do to prevent the timing out, but still keep the sessions going?
E
- Next message: Patrick C. Cole: "RE: Forms Authentication and SSL"
- Previous message: Kipp Hawley: "Re: What is the possible cause of this error message?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|