public DeleteCookieContext(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.CookieOptions options, string name)
 {
 }
 /// <summary>
 /// Modify Cookie options
 /// </summary>
 public virtual void CookieOptionsFilter(Cookie cookie, Microsoft.AspNetCore.Http.CookieOptions cookieOptions)
 {
 }
Beispiel #3
0
 public void Delete(string key, Microsoft.AspNetCore.Http.CookieOptions options)
 {
 }
 public AppendCookieContext(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.CookieOptions options, string name, string value)
 {
 }
Beispiel #5
0
        void SetCookie(string value)
        {
            DateTime? expires = null;
            if (String.IsNullOrWhiteSpace(value))
            {
                var existingValue = GetCookie();
                if (existingValue == null)
                {
                    // no need to write cookie to clear if we don't already have one
                    return;
                }

                value = ".";
                expires = DateTime.Now.AddYears(-1);
            }

            var opts = new Microsoft.AspNetCore.Http.CookieOptions
            {
                HttpOnly = true,
                Secure = Secure,
                Path = CookiePath,
                Expires = expires
            };

            _context.HttpContext.Response.Cookies.Append(CookieName, value, opts);
        }
Beispiel #6
0
 public void Append(string key, string value, Microsoft.AspNetCore.Http.CookieOptions options)
 {
 }
Beispiel #7
0
        public IActionResult Index(Models.Home.Index m, string submit)
        {
            try
            {
                if (submit == "teacher")
                {
                    Services.Hashing hashing    = new Services.Hashing();
                    string           hashedPass = hashing.CreateHashing(m.Password);


                    int    userType     = 2;
                    string errorMessage = "";
                    db.ValidateUser(m.Email, hashedPass, ref errorMessage, ref userType);
                    m.ErrorMessage = errorMessage;
                    string cookieValue   = m.Email + "-" + hashedPass + "-" + userType;
                    var    cookieOptions = new Microsoft.AspNetCore.Http.CookieOptions()
                    {
                        HttpOnly = true,
                        Expires  = DateTime.Now.AddDays(7)
                    };
                    if (Response != null)
                    {
                        Response.Cookies.Append("User", cookieValue, cookieOptions);
                    }
                    if (userType == 0)
                    {
                        return(Redirect("/Teacher/Opret/"));
                    }

                    else if (userType == 1)
                    {
                        return(Redirect("/Admin/Administration/"));
                    }

                    else
                    {
                        ViewBag.ErrorMessage = errorMessage;
                    }
                }
                else
                {
                    bool check = db.CheckSurveyCode(m.SurveyCode);

                    string cookieValue   = m.SurveyCode;
                    var    cookieOptions = new Microsoft.AspNetCore.Http.CookieOptions()
                    {
                        HttpOnly = true,
                        Expires  = DateTime.Now.AddDays(7)
                    };
                    if (Response != null)
                    {
                        Response.Cookies.Append("SurveyCode", cookieValue, cookieOptions);
                    }
                    if (check == true)
                    {
                        return(Redirect("/Student/OpretSvar/"));
                    }
                }
            }
            catch
            {
                m.ErrorMessage       = "Felterne skal udfyldes";
                ViewBag.ErrorMessage = m.ErrorMessage;
            }
            return(View(m));
        }
Beispiel #8
0
 public CookieSigningOutContext(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Authentication.AuthenticationScheme scheme, Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions options, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, Microsoft.AspNetCore.Http.CookieOptions cookieOptions) : base(default(Microsoft.AspNetCore.Http.HttpContext), default(Microsoft.AspNetCore.Authentication.AuthenticationScheme), default(Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions), default(Microsoft.AspNetCore.Authentication.AuthenticationProperties))
 {
 }
Beispiel #9
0
 public void DeleteCookie(Microsoft.AspNetCore.Http.HttpContext context, string key, Microsoft.AspNetCore.Http.CookieOptions options)
 {
 }
Beispiel #10
0
 public CookieSigningInContext(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Authentication.AuthenticationScheme scheme, Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions options, System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, Microsoft.AspNetCore.Http.CookieOptions cookieOptions) : base(default(Microsoft.AspNetCore.Http.HttpContext), default(Microsoft.AspNetCore.Authentication.AuthenticationScheme), default(Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions), default(Microsoft.AspNetCore.Authentication.AuthenticationProperties))
 {
 }
Beispiel #11
0
 public void AppendResponseCookie(Microsoft.AspNetCore.Http.HttpContext context, string key, string value, Microsoft.AspNetCore.Http.CookieOptions options)
 {
 }