Reputation: 9
I want to create cookie without setting expiry time.
Upvotes: 0
Views: 188
Reputation: 7708
MSDN :
For a cookie to effectively never expire, you can set the expiration date to be 50 years from now.
Be careful that if you create a cookie without an expiry time:
If you do not set the cookie's expiration, the cookie is created but it is not stored on the user's hard disk. Instead, the cookie is maintained as part of the user's session information. When the user closes the browser, the cookie is discarded.
Upvotes: 1