-1

I wonder what the default value is when I do not set the cookie expiration time.

I know that the expiration time of cookies is only for writing, so it can not be read by the development team.
I know that cookies usually stay on the web without leaving the site. So if you do not keep up with the site, will the cookie value stay alive forever? Several hours a few months even years??

I also heard that if you do not set an expiration time like JavaScript, you will lose cookies after midnight, but I wonder if this is true. If so, asp's cookies will expire after midnight.

GameDroids
  • 5,584
  • 6
  • 40
  • 59
Garam
  • 1
  • Cookies never stay "on the web", they are stored on your computer. And by setting one and inspecting it in your browser, you will see the default expiration time – Nico Haase Dec 19 '17 at 11:27
  • 1
    As this is specifically a Classic ASP question - do you mean cookies or session variables? The default period after which a session expires is 20 minutes. – John Dec 19 '17 at 12:42
  • 1
    Possible duplicate of [legacy (classic) ASP code session issue](https://stackoverflow.com/questions/951774/legacy-classic-asp-code-session-issue) – user692942 Dec 19 '17 at 17:11
  • Thank for your answer. I lacked concept and i was confused session and cookies. – Garam Dec 20 '17 at 10:42

1 Answers1

0

I wonder what the default value is when I do not set the cookie expiration time.

I know that cookies usually stay on the web without leaving the site. So if you do not keep up with the site, will the cookie value stay alive forever? Several hours a few months even years??

Unless an expiry date is given to the cookie, they will remain for as long as the active session on that particular set. The default IIS setting is 20 minutes I believe, but can vary upon the IIS settings. Keep in mind that they do not exist on the server (unless you're referring to Sessions) but rather on the clients machine, which they can clear whenever.

I know that the expiration time of cookies is only for writing, so it can not be read by the development team.

you can both read from a cookie, as well as write to a cookie. This is independent of whether the cookie is set on the client or the server side.

I also heard that if you do not set an expiration time like JavaScript, you will lose cookies after midnight, but I wonder if this is true. If so, asp's cookies will expire after midnight.

Nope, they are set either bu setting an expiry time on the cookie or the default session timeout setting in IIS

Community
  • 1
  • 1
Josh Montgomery
  • 882
  • 5
  • 10