Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SessionIDManager::Encode Method

Encodes the session identifier for saving to either a cookie or the URL.

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

public:
virtual String^ Encode(
	String^ id
)

Parameters

id
Type: System::String

The session identifier to encode.

Return Value

Type: System::String
The encoded session identifier.

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

This method is used internally by the SessionIDManager class to encode custom SessionID values created by classes that inherit the SessionIDManager class and override the CreateSessionID and Validate methods. To ensure the fidelity of a custom session-identifier value stored in the HTTP response by the SaveSessionID method, the SessionIDManager encodes the custom value using the UrlEncode method.

For an example of a class that inherits the SessionIDManager class and overrides the CreateSessionID and Validate methods, see the CreateSessionID method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft