
Contents | 413
SessionState
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Timeout
Integer = Session.Timeout
Session. Timeout = Integer
Returns or sets an integer containing the amount of time, in minutes, that can
elapse between requests without the session being destroyed. If the timeout value
is exceeded, the current session is destroyed and the Session.End event is fired.
Parameter
Integer
An integer variable that will receive or set the Timeout property value.
Example
The example writes the current value of the Timeout property to the Text prop-
erty of the Message ASP.NET Label control:
Sub Page_Load( )
Message.Text = "Current Session timeout value is " & _
Session.Timeout & " minutes."
End Sub
Notes
You can use the Timeout property to temporarily override the timeout setting
configured in web.config or machine.config, if you wish to make the value more
restrictive for some reason.
Collections Reference
Contents
HttpSessionState = Session.Contents
Returns a reference to the current HttpSessionState instance.
Parameter
HttpSessionState
A variable of type HttpSessionState that will receive the Contents reference.
Example
The example below calls the RemoveAll method through the Contents collection
reference and then writes a message:
Sub Page_Load( )
Session.Contents.RemoveAll( )
Message.Text = "Removed all items from current Session." ...