Solved

cookies and application.cfm

Posted on 2004-10-18
3
199 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

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.
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 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