Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

cookie and sliding expiration

$
0
0
i use the following code in the Page_Load event in all of the *.aspx.cs pages to slide the expiration date of the cookie. it works but i just have to include in all of the pages. is there a better or the correct way to slide the expiration of the cookie? private void Page_Load(object sender, System.EventArgs e) { HttpCookie cookie = Request.Cookies.Get(FormsAuthentication.FormsCookieName); cookie.Expires = DateTime.Now + new TimeSpan (0, 0, 30, 0); Response.Cookies.Set(cookie); }

Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>