Esempio n. 1
0
        void context_PostRequestHandlerExecute(object sender, EventArgs e)
        {
            HttpContext   context = HttpContext.Current;
            UploadSession session = SlickUploadContext.CurrentUploadSessionInternal;

            if (session != null && session.State != UploadState.Uploading)
            {
                SlickUploadContext.CommitSession(session);
            }

            ComponentHelper.EnsureScriptsRendered();

            // We're set to use session state, but we didn't create a cookie. Ensure we do.
            if (HttpContext.Current.Items["EnsureSessionCreated"] != null)
            {
                HttpCookie cookie = context.Response.Cookies[_sessionCookieName];

                if (cookie == null)
                {
                    cookie = new HttpCookie(_sessionCookieName, context.Session.SessionID)
                    {
                        Path = "/", HttpOnly = true
                    }
                }
                ;
                else
                {
                    cookie.Value = context.Session.SessionID;
                }

                context.Items["SlickUploadSessionStateFixCookie"] = cookie;
            }
        }