ISessionIDManager.SaveSessionID メソッド
アセンブリ: System.Web (system.web.dll 内)

Sub SaveSessionID ( _ context As HttpContext, _ id As String, _ <OutAttribute> ByRef redirected As Boolean, _ <OutAttribute> ByRef cookieAdded As Boolean _ )
Dim instance As ISessionIDManager Dim context As HttpContext Dim id As String Dim redirected As Boolean Dim cookieAdded As Boolean instance.SaveSessionID(context, id, redirected, cookieAdded)
void SaveSessionID ( HttpContext^ context, String^ id, [OutAttribute] bool% redirected, [OutAttribute] bool% cookieAdded )
void SaveSessionID ( HttpContext context, String id, /** @attribute OutAttribute() */ /** @ref */ boolean redirected, /** @attribute OutAttribute() */ /** @ref */ boolean cookieAdded )

HttpApplication.AcquireRequestState イベントの発生中に、SessionStateModule オブジェクトによって SaveSessionID メソッドが呼び出されます。SaveSessionID メソッドは、URL (Cookie なしのセッション状態を使用する場合) または無期限のセッション Cookie にセッション識別子を保存します。
CreateSessionID の実装が返す値に HTTP 応答または要求で無効な文字が含まれる場合、UrlEncode メソッドを使用して、SaveSessionID メソッドの実装のセッション識別子値をエンコードし、UrlDecode メソッドを使用して、GetSessionID メソッドの実装のセッション識別子値をデコードする必要があります。

GetSessionID メソッドの部分的な実装のコード例を次に示します。カスタムのセッション ID マネージャが Cookie なしのセッション識別子をサポートする場合、ISAPI フィルタなどのセッション識別子を URL に含めてやり取りするソリューションを実装する必要があります。
Public Sub SaveSessionID(context As HttpContext, _ id As String, _ ByRef redirected As Boolean, _ ByRef cookieAdded As Boolean) _ Implements ISessionIDManager.SaveSessionID redirected = False cookieAdded = False If pConfig.Cookieless = HttpCookieMode.UseUri Then ' Add the SessionID to the URI. Set the redirected variable as appropriate. redirected = True Return Else context.Response.Cookies.Add(New HttpCookie(pConfig.CookieName, id)) cookieAdded = True End If End Sub
public void SaveSessionID(HttpContext context, string id, out bool redirected, out bool cookieAdded) { redirected = false; cookieAdded = false; if (pConfig.Cookieless == HttpCookieMode.UseUri) { // Add the SessionID to the URI. Set the redirected variable as appropriate. redirected = true; return; } else { context.Response.Cookies.Add(new HttpCookie(pConfig.CookieName, id)); cookieAdded = true; } }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からISessionIDManager.SaveSessionID メソッドを検索する場合は、下記のリンクをクリックしてください。

- ISessionIDManager.SaveSessionID メソッドのページへのリンク