System.Web.SessionState.SessionId.Create C# (CSharp) Method

Create() static private method

static private Create ( ) : string
return string
		internal static string Create ()
		{
			byte[] key = new byte [half_len];

			lock (rng) {
				rng.GetBytes (key);
			}
			return MachineKeySectionUtils.GetHexString (key);
		}

Usage Example

Example #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);
        }
All Usage Examples Of System.Web.SessionState.SessionId::Create