SessionIDManager..::.SaveSessionID Method Home
This page is specific to:.NET Framework Version:2.03.03.54.0
.NET Framework Class Library
SessionIDManager..::.SaveSessionID Method

Saves a newly created session identifier to the HTTP response.

Namespace:  System.Web.SessionState
Assembly:  System.Web (in System.Web.dll)
Syntax

'Usage

Dim instance As SessionIDManager
Dim context As HttpContext
Dim id As String
Dim redirected As Boolean
Dim cookieAdded As Boolean

instance.SaveSessionID(context, id, redirected, _
    cookieAdded)

'Declaration

Public Sub SaveSessionID ( _
    context As HttpContext, _
    id As String, _
    <OutAttribute> ByRef redirected As Boolean, _
    <OutAttribute> ByRef cookieAdded As Boolean _
)

Parameters

context
Type: System.Web..::.HttpContext
The current HttpContext object that references server objects used to process HTTP requests (for example, the Request and Response properties).
id
Type: System..::.String
The session identifier.
redirected
Type: System..::.Boolean%
When this method returns, contains a Boolean value that is true if the response is redirected to the current URL with the session identifier added to the URL; otherwise, false.
cookieAdded
Type: System..::.Boolean%
When this method returns, contains a Boolean value that is true if a cookie has been added to the HTTP response; otherwise, false.

Implements

ISessionIDManager..::.SaveSessionID(HttpContext, String, Boolean%, Boolean%)
Exceptions

ExceptionCondition
HttpException

The response has already been sent.

-or-

The session ID passed to this method failed validation.

Remarks

This method is not intended to be called from application code.

The SaveSessionID method is called by the SessionStateModule object during the AcquireRequestState event. The SaveSessionID method stores the session identifier in either the URL (when cookieless session state is used) or in a non-expiring session cookie.

By default, the SessionIDManager places a unique session identifier into a non-expiring session cookie and sets the cookieAdded parameter to true.

For a cookieless session state, the SessionIDManager object inserts a unique session identifier into the current URL, redirects the browser to the new URL that includes the session identifier, and then sets the redirected parameter to true.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0
See Also

Reference

Other Resources

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View