Đang xem: How to destroy or remove a cookie in php
Value: This is the value of the cookie. This can at-most be around 4kb. The 4093 byte limit is for the entire cookie, but assuming a reasonable size for other fields, we can specify that the value can have at-most of about 4000 bytes.Comment: An optional field that is rarely used. You specify a string that explains why and what the cookie is used for.Expires: The expires field sets the exact time when the cookie is set to expire or become invalid. The time is set using the format Wdy, DD Mon YYYY HH:MM:SS GMTMax-Age: Another way to specify the expiration time. It specifies the time interval in seconds, which is calculated from the time the cookie is set. If both Max-Age and Expires is set, then Max-Age takes preference.
Path: You can optionally set the path of the webpage that the cookie is set for.Domain: You can also explicitly set the domain name for which this cookie is set for. If not specified, then the defaults to the domain that requested the URL.Secure: No value need to be specified here. Adding the keyword Secure to the cookie will make sure that only secure and encrypted connections such as HTTPS is used to set the cookie.