Create() static private method

static private Create ( ) : string
return string
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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());
 }
Ejemplo n.º 5
0
 // Create a session id.
 virtual public String CreateSessionID(HttpContext context)
 {
     return(SessionId.Create(ref _randgen));
 }