Dhiraj
Dhiraj

Reputation: 9

How can i create cookies in asp.net without setting expiry time?

I want to create cookie without setting expiry time.

Upvotes: 0

Views: 188

Answers (2)

Amulya Khare
Amulya Khare

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

Waqas
Waqas

Reputation: 6802

Set the expiration date to far future, like 2020

Upvotes: 0

Related Questions