By default what will be the expiration time of a cookie added using C# code?
HttpCookie myCookie= new HttpCookie("myCookie");
myCookie.Value = txtCookie.Text;
// Add the cookie.
Response.Cookies.Add(myCookie);
By default what will be the expiration time of a cookie added using C# code?
HttpCookie myCookie= new HttpCookie("myCookie");
myCookie.Value = txtCookie.Text;
// Add the cookie.
Response.Cookies.Add(myCookie);
The default Expires value for a cookie is not a static time, but it creates a Session cookie. This will stay active until the user closes their browser/clears their cookies. You can override this as required.
From the linked page:
Setting the Expires property to MinValue makes this a session Cookie, which is its default value
document.cookie = 'asd=123'
it persists till you close the browser too unless you specified an expiration time? –
Gargoyle 20 minutes.
In IIS, click on your website, and go to Session State. In the second box (Cookie Settings), you can change the time out(in minutes).
© 2022 - 2024 — McMap. All rights reserved.