public HttpSessionState UpdateContext(HttpContext context, SessionStateModule module, bool required, bool read_only, ref bool isNew) { if (!required) { return(null); } HttpSessionState session = null; string id = SessionId.Lookup(context.Request, config.CookieLess); if (id != null) { session = SelectSession(id, read_only); if (session != null) { return(session); } } id = SessionId.Create(); session = new HttpSessionState(id, new SessionDictionary(), HttpApplicationFactory.ApplicationState.SessionObjects, config.Timeout, true, config.CookieLess, SessionStateMode.SQLServer, read_only); InsertSessionWithRetry(session, config.Timeout); isNew = true; return(session); }
public HttpSessionState UpdateContext(HttpContext context, SessionStateModule module, bool required, bool read_only, ref bool isNew) { if (!required) { return(null); } Cache cache = HttpRuntime.InternalCache; HttpSessionState state = null; string id = SessionId.Lookup(context.Request, config.CookieLess); if (id != null) { state = (HttpSessionState)cache ["@@@InProc@" + id]; if (state != null) { return(state); } } // Create a new session. string sessionID = SessionId.Create(); state = new HttpSessionState(sessionID, // unique identifier new SessionDictionary(), // dictionary HttpApplicationFactory.ApplicationState.SessionObjects, config.Timeout, //lifetime before death. true, //new session false, // is cookieless SessionStateMode.InProc, read_only); //readonly TimeSpan timeout = new TimeSpan(0, config.Timeout, 0); cache.Insert(INPROC_CACHE_PREFIX + sessionID, state, null, Cache.NoAbsoluteExpiration, timeout, CacheItemPriority.AboveNormal, removedCB); isNew = true; return(state); }
public virtual string CreateSessionID(HttpContext context) { return(SessionId.Create(ref this._randgen)); }
// Todo: find use for the context parameter? public virtual string CreateSessionID(HttpContext context) { return(SessionId.Create()); }
// Create a session id. virtual public String CreateSessionID(HttpContext context) { return(SessionId.Create(ref _randgen)); }