Solved

cookies and application.cfm

Posted on 2004-10-18
3
190 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
3 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 200 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 50 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Server with multiple sites and SSL 14 62
Application launch issue with Apache Tomcat 5 22
Forbidden errors 5 123
Firewall Speed Issue 6 66
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…
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 …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

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

14 Experts available now in Live!

Get 1:1 Help Now