using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; namespace Neo.Legitimate.Common.Helpers { public static class WebHelper { #region SetLastPageVisited public static void SetLastPageVisited(HttpContextBase context, string lastPage) { if (context.Request.Cookies["lastpage"] == null) { var cookie = new System.Web.HttpCookie("lastpage") { Value = lastPage, Expires = System.DateTime.Now.AddDays(30) }; context.Response.Cookies.Add(cookie); } else { var cookie = context.Request.Cookies["lastpage"]; cookie.Value = lastPage; cookie.Expires = System.DateTime.Now.AddDays(30); context.Response.SetCookie(cookie); } } #endregion } }