/// <summary>
        /// Sets the authorized user.
        /// </summary>
        /// <param name="authorize">The authorize.</param>
        private void SetAuthorizedUser(Authorization authorize)
        {
            User user = authorize.RetrieveUser();

            HttpCookie sessionCookie = new HttpCookie(AdminResources.AdminSessionCookieName);
            sessionCookie["Token"] = new UserLogic().GenerateUserToken(user.ServiceKey);
            sessionCookie["Meat"] = "Chicken";
            sessionCookie.Expires = DateTime.Now.AddMonths(1);

            Authorization.SetUnencryptedCookie(sessionCookie);

            CurrentUser = user;
            Thread.CurrentPrincipal = CurrentUser;
        }
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Page.InitComplete"/> event after page initialization.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
        protected override void OnInitComplete(EventArgs e)
        {
            base.OnInitComplete(e);

            Authorization authorize = new Authorization();
            bool isAuthorized = authorize.AuthenticatedUser();

            if(isAuthorized)
            {
                SetAuthorizedUser(authorize);
            }
            else
            {
                Response.Redirect("~/Login.aspx");
            }
        }