Solved

Setting a 20 minute expiration on a cfcookie

Posted on 2009-05-07
1
1,020 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

628 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