MaxAge property: Cookie class

Description

This property represents the maximum specified age of the cookie, as a signed number in seconds. The default value is -1. Setting the MaxAge property to a negative value ensures the cookie does not persist on the client when the client session ends. If the MaxAge property is set to zero, the cookie is deleted immediately from the client.

Value Description

Non Negative Integer

Lifetime of the Cookie in seconds

0

Delete the cookie from the client immediately

-1

Default MaxAge property value (remove the cookie after the client exits)

Negative Integer

Remove the cookie after the client exits

This property is read/write.