don't seem to be able to set the expiration date of a cookie within cfscript. any hints? it's coldfusion 9 btw.
Set an expiration date for a cookie This can be done easily by adding expires=expirationDate in UTC separated by semicolon from the name=value, as seen in the following example: document. cookie = "username=Max Brown; expires=Wed, 05 Aug 2020 23:00:00 UTC"; document.
Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If not set, the cookie will expire at the end of the session (when the browser closes). The path on the server in which the cookie will be available on.
On the left side, under the Storage section, you'll see Cookies. Click on the arrow to display the website, then click on it. This will display all sorts of information about cookies, including their expiration date in the Expires/Max-Age column.
Read the numbers after the letter as the date of the month and the year in which the item was produced. For example, if a code reads "D1519," that means April 15, 2019. Many products might have a closed code as well as an open-date code.
The <cfscript>
equivalent to <cfcookie>
offers only direct assignment of Cookie scope memory-only variables. You cannot use direct assignment to set persistent cookies that are stored on the user system. So you will have to write a wrapper function, if you want to set permanent cookies using script only CFML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With