Exemplo n.º 1
0
 public static void ClearProposedClosingDate(this IResponseCookies cookies, IHostingEnvironment hostingEnvironment, Guid vacancyId)
 {
     cookies.Delete(string.Format(CookieNames.VacancyProposedClosingDate, vacancyId), EsfaCookieOptions.GetSessionLifetimeHttpCookieOption(hostingEnvironment));
 }
Exemplo n.º 2
0
 public static void SetProposedStartDate(this IResponseCookies cookies, IHostingEnvironment hostingEnvironment, Guid vacancyId, DateTime date)
 {
     cookies.Append(string.Format(CookieNames.VacancyProposedStartDate, vacancyId), date.ToShortDateString(), EsfaCookieOptions.GetSessionLifetimeHttpCookieOption(hostingEnvironment));
 }
Exemplo n.º 3
0
 public static void DeleteSessionCookie(this IResponseCookies cookies, IHostingEnvironment hostingEnvironment, string key)
 {
     cookies.Delete(key, EsfaCookieOptions.GetSessionLifetimeHttpCookieOption(hostingEnvironment));
 }
        public void WriteCookie(HttpResponse response, string userId, string employerAccountId)
        {
            var protectedValue = _dataProtector.Protect($"{userId}-{employerAccountId}");

            response.Cookies.Append(CookieNames.LevyEmployerIndicator, protectedValue, EsfaCookieOptions.GetDefaultHttpCookieOption(_hostingEnvironment));
        }
Exemplo n.º 5
0
        public IActionResult DismissOutageMessage([FromForm] string returnUrl)
        {
            const string SeenCookieValue = "1";

            if (!Request.Cookies.ContainsKey(CookieNames.SeenOutageMessage))
            {
                Response.Cookies.Append(CookieNames.SeenOutageMessage, SeenCookieValue, EsfaCookieOptions.GetSingleDayLifetimeHttpCookieOption(_hostingEnvironment, _timeProvider));
            }

            if (IsValidReturnUrl(returnUrl))
            {
                return(Redirect(returnUrl));
            }

            return(RedirectToRoute(RouteNames.Dashboard_Index_Get));
        }
Exemplo n.º 6
0
 public static void SetSessionCookie(this IResponseCookies cookies, IHostingEnvironment hostingEnvironment, string key, string value)
 {
     cookies.Append(key, value, EsfaCookieOptions.GetSessionLifetimeHttpCookieOption(hostingEnvironment));
 }
        public void WriteCookie(HttpResponse response, string userId, string employerAccountId, bool hasEoi)
        {
            var protectedValue = _dataProtector.Protect(userId + "/" + employerAccountId + "/" + hasEoi);

            response.Cookies.Append(CookieNames.EmployerEoi, protectedValue, EsfaCookieOptions.GetDefaultHttpCookieOption(_hostingEnvironment));
        }