
412
|
Chapter 19: The HttpSessionState Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Notes
The Mode property allows you to test the current mode of session state storage.
One use for this property is to determine whether to store information in the
Session collection, depending on the mode. Because both the StateServer and
SQLServer modes require cross-process communication (which can be very
expensive relative to in-process communication), you may wish to provide alter-
native means for storing certain information if one of these modes is used. Using
the Mode property, you can write conditional statements that will decide at
runtime whether or not to store a particular value based on the current session
state mode. That way, if the session state mode is changed administratively, no
change to your code is required.
SessionID
String = Session.SessionID
Returns a string containing the unique identifier for the current session.
Parameters
String
A string variable that will receive the session ID property value.
Example
See the example for the IsReadOnly property.
Notes
The SessionID property value is generated the first time a page for which session
state has not been disabled is requested. As noted earlier, the actual session is not
created unless either an event handler is provided in global.asax for the Session.
Start event or a value ...