Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

218 lines
15 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Type Name="SessionStateUtility" FullName="System.Web.SessionState.SessionStateUtility">
<TypeSignature Language="C#" Value="public static class SessionStateUtility" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Web.SessionState.SessionStateUtility" /> class provides static helper methods that are used by a session-state module or a session-state store provider. Application developers will not need to call these methods from their code.</para>
<para>The following table describes the ways the session-state module and session-state store provider use the methods.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Method</para>
</term>
<description>
<para>Use</para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="M:System.Web.SessionState.SessionStateUtility.GetHttpSessionStateFromContext(System.Web.HttpContext)" /> method</para>
</term>
<description>
<para>Can be used by custom session-state modules to either retrieve session information for an existing session or create session information for a new session.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Web.SessionState.SessionStateUtility.AddHttpSessionStateToContext(System.Web.HttpContext,System.Web.SessionState.IHttpSessionState)" /> method</para>
</term>
<description>
<para>Called by the session-state module to add the session data to the current <see cref="T:System.Web.HttpContext" /> and make it available to application code through the <see cref="P:System.Web.HttpContext.Session" /> property.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Web.SessionState.SessionStateUtility.RemoveHttpSessionStateFromContext(System.Web.HttpContext)" /> method</para>
</term>
<description>
<para>Called by the session-state module during the <see cref="E:System.Web.HttpApplication.ReleaseRequestState" /> or <see cref="E:System.Web.HttpApplication.EndRequest" /> events at the end of a request, to clear session data from the current <see cref="T:System.Web.HttpContext" />.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Web.SessionState.SessionStateUtility.GetSessionStaticObjects(System.Web.HttpContext)" /> method</para>
</term>
<description>
<para>Called by the session-state module to get a reference to the <see cref="P:System.Web.SessionState.HttpSessionState.StaticObjects" /> collection based on objects defined in the Global.asax file. The <see cref="T:System.Web.HttpStaticObjectsCollection" /> collection returned is included with the session data added to the current <see cref="T:System.Web.HttpContext" />.</para>
</description>
</item>
</list>
<para>Session data is passed to and retrieved from the current <see cref="T:System.Web.HttpContext" /> as an <see cref="T:System.Web.SessionState.HttpSessionStateContainer" /> object or any valid implementation of the <see cref="T:System.Web.SessionState.IHttpSessionState" /> interface.</para>
<para>For information about implementing a session-state store provider, see <format type="text/html"><a href="baadfec5-c881-468a-9681-7d8796b05a66">Implementing a Session State Store Provider</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Provides helper methods used by session-state modules and session-state store providers to manage session information for an ASP.NET application. This class cannot be inherited.</para>
</summary>
</Docs>
<Members>
<Member MemberName="AddHttpSessionStateToContext">
<MemberSignature Language="C#" Value="public static void AddHttpSessionStateToContext (System.Web.HttpContext context, System.Web.SessionState.IHttpSessionState container);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.Web.HttpContext" />
<Parameter Name="container" Type="System.Web.SessionState.IHttpSessionState" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Web.SessionState.SessionStateUtility.AddHttpSessionStateToContext(System.Web.HttpContext,System.Web.SessionState.IHttpSessionState)" /> method is used by a session-state module to apply session data to the current request. This occurs during the <see cref="E:System.Web.HttpApplication.AcquireRequestState" /> event at the beginning of a request. Session data for the current request is either retrieved for an existing session or created for a new session. The session data is then encapsulated in an <see cref="T:System.Web.SessionState.IHttpSessionState" /> implementation instance, which is passed to the <see cref="M:System.Web.SessionState.SessionStateUtility.AddHttpSessionStateToContext(System.Web.HttpContext,System.Web.SessionState.IHttpSessionState)" /> method along with the current <see cref="T:System.Web.HttpContext" />. The supplied session data is then made available to application code through the <see cref="P:System.Web.HttpContext.Session" /> property of the current context.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Applies the session data to the context for the current request.</para>
</summary>
<param name="context">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Web.HttpContext" /> object to which to add the <see cref="T:System.Web.SessionState.HttpSessionState" /> object.</param>
<param name="container">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Web.SessionState.IHttpSessionState" /> implementation instance to add to the specified HTTP context.</param>
</Docs>
</Member>
<Member MemberName="GetHttpSessionStateFromContext">
<MemberSignature Language="C#" Value="public static System.Web.SessionState.IHttpSessionState GetHttpSessionStateFromContext (System.Web.HttpContext context);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.SessionState.IHttpSessionState</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.Web.HttpContext" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Web.SessionState.SessionStateUtility.GetHttpSessionStateFromContext(System.Web.HttpContext)" /> method can be used by a session-state module to retrieve session data from the current request. This occurs during the <see cref="E:System.Web.HttpApplication.ReleaseRequestState" /> event at the end of a request. The returned session data can then be written to the session data store. If the session has been abandoned, the session data can be removed from the data store and <see cref="T:System.Web.HttpContext" />, and the <system>Session_OnEnd</system> event can be executed. </para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Retrieves session data from the context for the current request.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.Web.SessionState.IHttpSessionState" /> implementation instance populated with session data from the current request.</para>
</returns>
<param name="context">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Web.HttpContext" /> from which to retrieve session data.</param>
</Docs>
</Member>
<Member MemberName="GetSessionStaticObjects">
<MemberSignature Language="C#" Value="public static System.Web.HttpStaticObjectsCollection GetSessionStaticObjects (System.Web.HttpContext context);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.HttpStaticObjectsCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.Web.HttpContext" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Web.SessionState.SessionStateUtility.GetSessionStaticObjects(System.Web.HttpContext)" /> method is used to retrieve the collection of static objects defined in the Global.asax file for the ASP.NET application. A session-state module implementation will supply the returned <see cref="T:System.Web.HttpStaticObjectsCollection" /> collection to the <see cref="T:System.Web.SessionState.IHttpSessionState" /> implementation instance that is added to the current context using the <see cref="M:System.Web.SessionState.SessionStateUtility.AddHttpSessionStateToContext(System.Web.HttpContext,System.Web.SessionState.IHttpSessionState)" /> method.</para>
<para>A <see cref="T:System.Web.SessionState.SessionStateStoreProviderBase" /> can also use the <see cref="M:System.Web.SessionState.SessionStateUtility.GetSessionStaticObjects(System.Web.HttpContext)" /> method when creating a <see cref="T:System.Web.SessionState.SessionStateStoreData" /> object.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a reference to the static objects collection for the specified context.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.Web.HttpStaticObjectsCollection" /> collection populated with the <see cref="P:System.Web.SessionState.HttpSessionState.StaticObjects" /> property value for the specified <see cref="T:System.Web.HttpContext" />.</para>
</returns>
<param name="context">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Web.HttpContext" /> from which to get the static objects collection.</param>
</Docs>
</Member>
<Member MemberName="RaiseSessionEnd">
<MemberSignature Language="C#" Value="public static void RaiseSessionEnd (System.Web.SessionState.IHttpSessionState session, object eventSource, EventArgs eventArgs);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="session" Type="System.Web.SessionState.IHttpSessionState" />
<Parameter Name="eventSource" Type="System.Object" />
<Parameter Name="eventArgs" Type="System.EventArgs" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Web.SessionState.SessionStateUtility.RaiseSessionEnd(System.Web.SessionState.IHttpSessionState,System.Object,System.EventArgs)" /> method is used by a session-state module to execute the <system>Session_OnEnd</system> event defined in the Global.asax file for an ASP.NET application. A session-state module will call the <see cref="M:System.Web.SessionState.SessionStateUtility.RaiseSessionEnd(System.Web.SessionState.IHttpSessionState,System.Object,System.EventArgs)" /> method when a session has been abandoned, or if the session expires.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Executes the <system>Session_OnEnd</system> event defined in the Global.asax file for the ASP.NET application.</para>
</summary>
<param name="session">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Web.SessionState.IHttpSessionState" /> implementation instance for the session that has ended.</param>
<param name="eventSource">
<attribution license="cc4" from="Microsoft" modified="false" />The event source object to supply to the Session_OnEnd event.</param>
<param name="eventArgs">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.EventArgs" /> object to supply to the Session_OnEnd event.</param>
</Docs>
</Member>
<Member MemberName="RemoveHttpSessionStateFromContext">
<MemberSignature Language="C#" Value="public static void RemoveHttpSessionStateFromContext (System.Web.HttpContext context);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.Web.HttpContext" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Web.SessionState.SessionStateUtility.RemoveHttpSessionStateFromContext(System.Web.HttpContext)" /> method clears session data from the specified <see cref="T:System.Web.HttpContext" />. A session-state module will call the <see cref="M:System.Web.SessionState.SessionStateUtility.RemoveHttpSessionStateFromContext(System.Web.HttpContext)" /> method in the handler for the <see cref="E:System.Web.HttpApplication.ReleaseRequestState" /> event.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Removes session data from the specified context.</para>
</summary>
<param name="context">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Web.HttpContext" /> from which to remove session data.</param>
</Docs>
</Member>
</Members>
</Type>