void OnAuthenticateRequest(object sender, EventArgs args)
        {
            HttpApplication   app = (HttpApplication)sender;
            BaseWorkerRequest req = J2EEUtils.GetWorkerRequest(app.Context);

            if (req.GetRemoteUser() != null)
            {
                app.Context.User = new ServletPrincipal(req);
            }
        }
예제 #2
0
        internal static HttpSession GetSession(HttpContext context, bool create, bool throwOnError)
        {
            HttpSession session = J2EEUtils.GetWorkerRequest(context).GetSession(create);

            if (session == null && throwOnError)
            {
                throw new HttpException("Session is not established");
            }

            return(session);
        }
예제 #3
0
            }                                                          // For Java deserialization

            public ServletSessionStateItemCollection(HttpContext context)
                : this()
            {
                _items         = new SessionStateItemCollection();
                _staticObjects = new HttpStaticObjectsCollection();

                if (context != null)
                {
                    ServletContext servletContext     = J2EEUtils.GetWorkerRequest(context).GetContext();
                    string         sessionPersistance = servletContext.getInitParameter(J2EEConsts.Enable_Session_Persistency);
                    if (sessionPersistance != null)
                    {
                        try {
                            _needSessionPersistence = Boolean.Parse(sessionPersistance);
                        }
                        catch (Exception) {
                            _needSessionPersistence = false;
                            Debug.WriteLine("EnableSessionPersistency init param's value is invalid. the value is " + sessionPersistance);
                        }
                    }
                }
            }
예제 #4
0
        public string GetSessionID(HttpContext context)
        {
            BaseWorkerRequest request = J2EEUtils.GetWorkerRequest(context);

            return(request.IsRequestedSessionIdValid() ? request.GetRequestedSessionId() : null);
        }