示例#1
0
        private void Create(HttpResponse response, CancellationToken cancel)
        {
            ModuleRuntimeSession sess = Prov.Create();

            response.Headers[Session.SessionIdName] = sess.SessionId.ToString();
            RestUtils.Push(response, RestUtils.JsonOpStatus(JsonOpStatus.Ok));
        }
示例#2
0
        static void DoWork(string[] args)
        {
            Console.WriteLine("PreBootstrap State: " + SessionManager.Instance.State.ToString());
            SessionManager.Instance.Bootstrap(); // new Osrs.Reflection.TypeNameReference("Osrs.Security.Sessions.Module", "Osrs.Security.Sessions.Providers.MemorySessionProviderFactory"), 0);
            Console.WriteLine("PostBootstrap State: " + SessionManager.Instance.State.ToString());
            SessionManager.Instance.Initialize();
            Console.WriteLine("PostInitialize State: " + SessionManager.Instance.State.ToString());
            SessionManager.Instance.Start();
            Console.WriteLine("PostStart State: " + SessionManager.Instance.State.ToString());

            SessionProviderBase prov = SessionManager.Instance.GetProvider();

            Console.WriteLine("Provider null: " + (prov == null));
            if (prov != null)
            {
                ModuleRuntimeSession sess = prov.Create();
                Console.WriteLine("Session null: " + (sess == null));

                Console.WriteLine("exists: " + prov.Exists(sess.SessionId));
                Console.WriteLine("extend: " + prov.Extend(sess.SessionId));
                Console.WriteLine("expire: " + prov.Expire(sess.SessionId));
                Console.WriteLine("exists: " + prov.Exists(sess.SessionId));
            }
        }