?
Solved

cookies and application.cfm

Posted on 2004-10-18
3
Medium Priority
?
208 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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…
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

765 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