Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setting a 20 minute expiration on a cfcookie

Posted on 2009-05-07
1
Medium Priority
?
1,075 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 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

722 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