Solved

Setting a 20 minute expiration on a cfcookie

Posted on 2009-05-07
1
896 Views
Last Modified: 2013-12-24
I see from the documentation for cfcookie that the expration can be set via the Expires field:

http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-a18.htm

It pretty self explanatory if I want the cookie to remain for a few days, but when it comes to a few mintues how do I go about that?

Specifically I want to set a cookie to expire in 20 minutes and I would like the sample code to do that.
0
Comment
Question by:onaled777
1 Comment
 
LVL 63

Accepted Solution

by:
Zvonko earned 500 total points
ID: 24325433
Check this:
<cfcookie name = "ExpireTimeDemo"

   value = "#TimeFormat(DateAdd("n",20,NOW()))#"

   expires = "#DateAdd("n",20,NOW())#"> 
 

<script>

alert(unescape(document.cookie));

</script>

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Domain Name E-mail Address & Outlook Integration 3 39
URL redirect 4 51
Coldfusion Datefield problem 2 96
Recipient address rejected: User unknown in virtual alias table 1 271
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now