what is the default time of cookies and session in asp.net

Posted by Pkanwar under ASP.NET on 10/8/2013 | Points: 10 | Views : 872 | Status : [Member] | Replies : 3
what is the default time of cookies and session in asp.net?




Responses

Posted by: Jprathap on: 10/8/2013 [Member] Starter | Points: 25

Up
0
Down
It is 20 Minutes according to MSDN
MSDN:

Optional TimeSpan attribute.

Specifies the number of minutes a session can be idle before it is abandoned. The timeout attribute cannot be set to a value that is greater than 525,601 minutes (1 year) for the in-process and state-server modes. The session timeout configuration setting applies only to ASP.NET pages. Changing the session timeout value does not affect the session time-out for ASP pages. Similarly, changing the session time-out for ASP pages does not affect the session time-out for ASP.NET pages. The default is 20 minutes.



Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jprathap on: 10/8/2013 [Member] Starter | Points: 25

Up
0
Down
If u want know more : click this link : http://justgeeks.blogspot.se/2008/07/aspnet-session-timeouts.html

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 10/8/2013 [Member] Silver | Points: 25

Up
0
Down
Hi,

A cookie can keep information in the user's browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie. The trouble is that a user can block cookies or delete them at any time. If, for example, your website's shopping cart utilized cookies, and a person had their browser set to block them, then they could not shop at your website.

Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. So, if you had a site requiring a login, this couldn't be saved as a session like it could as a cookie, and the user would be forced to re-login every time they visit.

Mark as answer if satisfied....

Regards,
Shree M.


Kavya Shree Mandapalli

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response