views:

74

answers:

2

If you don't set an expiration for a cookie, will it be lost when the browser is closed?

+1  A: 

If it has no expiration, then it will. It will be treated as a Session cookie. An exception to this are new versions Firefox, which can save your session.

Greg Ogle
A: 

You are correct. If you don't set an expiration for a cookie it will be stored only in memory and removed when the session ends. If you do set an expiration, it will be stored on the hard disk.

AaronS