/// <summary> /// Gets the session. /// </summary> /// <param name="server">The server.</param> /// <param name="context">The context.</param> /// <returns>A session info for the given websocket context.</returns> #if NET47 public static SessionInfo GetSession(this WebServer server, System.Net.WebSockets.WebSocketContext context)
public static SessionInfo GetSession(this WebServer server, WebSocketContext context) #endif { return(server.SessionModule?.GetSession(context)); }
/// <summary> /// Gets the session object associated to the current context. /// Returns null if the LocalSessionWebModule has not been loaded. /// </summary> /// <param name="server">The server.</param> /// <param name="context">The context.</param> /// <returns>A session info for the given server context.</returns> public static SessionInfo GetSession(this WebServer server, HttpListenerContext context) { return(server.SessionModule?.GetSession(context)); }
/// <summary> /// Deletes the given session object. /// </summary> /// <param name="server">The server.</param> /// <param name="session">The session info.</param> public static void DeleteSession(this WebServer server, SessionInfo session) { server.SessionModule?.DeleteSession(session); }
/// <summary> /// Deletes the session object associated to the current context. /// </summary> /// <param name="server">The server.</param> /// <param name="context">The context.</param> public static void DeleteSession(this WebServer server, HttpListenerContext context) { server.SessionModule?.DeleteSession(context); }
/// <summary> /// Deletes the session object associated to the current context. /// </summary> /// <param name="context">The context.</param> /// <param name="server">The server.</param> public static void DeleteSession(this HttpListenerContext context, WebServer server) { server.DeleteSession(context); }
/// <summary> /// Gets the session object associated to the current context. /// Returns null if the LocalSessionWebModule has not been loaded. /// </summary> /// <param name="context">The context.</param> /// <param name="server">The server.</param> /// <returns>A session object for the given server context.</returns> public static SessionInfo GetSession(this HttpListenerContext context, WebServer server) { return(server.GetSession(context)); }