[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

cookies and application.cfm

Posted on 2004-10-18
3
Medium Priority
?
213 Views
Last Modified: 2013-12-24
Hi,
  Can anyone tell me what code to place in application.cfm to make cookies expire when clients browser is closed or client does a refresh? Also need to know how to set up sesesions and NOT use cookies. I am using dynamic data through Flash and CF is placing cookies on the clients PC that cause new/refreshed data to not show up.
If someone would take the time to give me more "control" items code related to this, to use in application.cfm  , I will add more points. This refresh is a big problem. I can't get the web site to work without using cookies and refreshing data is a big problem. I need to refresh the whole page, not just Flash.
Thanks,
Steve
0
Comment
Question by:SteveDallas
[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
3 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 800 total points
ID: 12338927
The only way to set up sessions and not use cookies is to pass the CFID and the CFTOKEN around in every URL of your site.  You can do this useing URLTOKEN

To make a cookie expire when the browser is closed - this can only work with memory only cookies.  You would use jsession (a setting in the CFAdministrator.

First of all you cannot place any code in the application.cfm to make cookies expire on browser close.  Application.cfm does not run then.  It runs on the LOAD of each page.

I do not think that you can expire cookies on the hard-drive (also known as file-cookies) upon browser close.

The best method would be to set up sessions like this :

<cfapplication
      name="MyApplication"
      sessionmanagement="yes"
      sessiontimeout="#CreateTimespan(0,0,60,0)#"> <!--- 60 minute session timeout --->

Then store information into the session scope instead of into the cookie scope
0
 
LVL 21

Assisted Solution

by:pinaldave
pinaldave earned 200 total points
ID: 12339290
Hi SteveDallas,

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pa3.htm#wp1097308
Some of the answer you can find from mrichmon's comment.

Also regarding when you click on refresh the cookies should expire, this is not possible usually as that is not good application. Sometime many reason one has to refresh the page and if cookies are expired user might find problem. In our office T1 gets down momentarily due to network problem so if the page is not loaded IE waits for while and reloads it automatically if it has not got proper response from the server.

Even though if you want on refersh.. this is what I would do. I will keep the variable at the end of the page to set. so when the page is properly loaded it will set the variable and if the variable is set then I will delete all the cookies and expire the session variable.

Regards,
---Pinal
0
 
LVL 2

Author Comment

by:SteveDallas
ID: 12393345
Hi,
  I solved this a couple of ways. I set CF to not use cookies. I use sessions. With this application I must refresh the page, having the cold fusion database query run at every refresh. We are using live, dynamic data. I will open another question to deal with passing a variable out from Flash Actionscript to CF to look for, in a loop.  THe thing that really stabilized this application was:  In Flash Actionscript - Create blank variables and create instances from those variables as the first thing the code does, before every attempting to load the external file and to put this in an external *.as file. That got rid of the intermittent "undefined" error. Thanks for your comments.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 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