What does your <CFAPPLICATION> look something like?

<cfapplication name="Foo"
        clientmanagement="no" [or yes of you are using client variables]
        sessionmanagement="yes"
        setclientcookies="yes"
        sessiontimeout="#CreateTimeSpan(0,0,10,0)#">

-----Original Message-----
From: Jennifer Perkins [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 6:59 PM
To: CF-Talk
Subject: RE: Cookie disappears... Still hoping for help!


Does anyone have any clues about what might be happening?  I'm pulling my
hair out over here...

Little more stuff I've tried:

The cookie file does not show up ANYWHERE on my computer, either before or
after I close the browser window. However, if I put <cfdump var="#cookie#">
on the homepage, I can see the cfid, cftoken and the poll cookie...until I
close the browser. Then when I reopen the browser window and go the site, I
see only cfid & cftoken.

I changed the expires attribute back to "never". Still no help.

It seems like the cookie is not really being written at all, it's storing it
more as a session variable, but for some reason CALLING it a cookie.
Enabling client variables (stored in DB or not) does not help either.


Jen Perkins
Macromedia Certified ColdFusion Developer
Carol/Trevelyan Strategy Group
Phone: 925-757-1839
http://www.ctsg.com/

Kumbaya, Dammit!
http://www.kumbayadammit.com/



-----Original Message-----
From: Jennifer Perkins [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 9:54 PM
To: CF-Talk
Subject: RE: Cookie disappears when browser closes!


It's a development site, so you can't view it.  When the visitor votes in
the poll, an action page is called that updates the database table, then the
user is redirected to this page, which sets the cookie (if the user just
voted) and displays the poll results.  Page code looks like this:

===========================================================================

<cfset request.app.headerFile="templates/front/header_noleft.cfm">
<cfset request.app.footerFile="templates/front/footer_noleft.cfm">

<cfparam name="attributes.pollID" default="10">

<cfif isdefined("attributes.voted") and attributes.voted>
        <cfcookie name="poll#attributes.pollID#" value="true" expires="12/31/2020">
</cfif>

<!---
**********************************************************************
*
*       Include global template header file
*
**********************************************************************
--->

<cftry>
        <cfinclude template="#request.app.headerFile#">
        <cfcatch type="MissingInclude">
                <!--- include some generic template --->
        </cfcatch>
</cftry>

<!--- display poll results --->
<cfinclude template="query/qry_pollresults.cfm">

<cfoutput query="qry_pollresults" group="pollID">
<!--- to get ALL answers, first loop through answers & tally chosen --->
<cfset totalvotes=0>
<cfoutput>
        <cfset totalvotes=evaluate(totalvotes+chosen)>
</cfoutput>
<table cellpadding=3 cellspacing=0 border=0><tr><td>
<h5>Poll Results</h5><br><br>
<table cellpadding=0 cellspacing=0 border=0 width="365">
        <tr>
                <td colspan=101 width="365" 
class="contenttext"><b>#question#</b><br></td>
        </tr>
        <cfoutput>
        <tr>
                <td colspan=101 width="365" height="10"></td>
        </tr>
        <tr>
                <td colspan=101 width="365" class="contenttext">#answer#</td>
        </tr>
        <tr>
                <cfloop from=1 to=100 index="i">
                <td width="3"><cfif totalvotes><cfif
numberformat(evaluate((chosen/totalvotes)*100), '999') lte i><cfelse><img
src="/images/votespace.gif" width=3 height=5
valign="center"></cfif></cfif></td>
                </cfloop>
                <td width="65" class="contenttext" align="right"><cfif
totalvotes>#numberformat(evaluate((chosen/totalvotes)*100),
'999')#%<cfelse>0%</cfif></td>
        </tr>
        </cfoutput>
        <tr>
                <td colspan=101 width="365"><br><b>Total votes: #totalvotes#</b></td>
        </tr>
</table>
</td></tr></table>
</cfoutput>


<!---
**********************************************************************
*
*       Include global template footer file
*
**********************************************************************
--->
<cftry>
        <cfinclude template="#request.app.footerFile#">
        <cfcatch type="MissingInclude">
                <!--- include some generic template --->
        </cfcatch>
</cftry>

===========================================================================

The code for the homepage, which displays the poll or poll results
(depending on if the cookie is set), contains the following code:

===========================================================================

<!--------------------- POLL ------------------------->
<!--- check for featured poll --->
<cfinclude template="query/qry_poll.cfm">
<!--- check for cookie first; if cookie exists for this poll, display
results, NOT poll --->
<cfif isdefined("cookie.poll#getMostRecent.pollID#")>
        <cfset attributes.pollID=getMostRecent.pollID>
        <cfinclude template="query/qry_pollresults.cfm">
        <cfset showpollresults=1>
<cfelse>
        <cfset showpollresults=0>
</cfif>

===========================================================================

The poll or poll results is actually displayed (based on the
"showpollresults" var) using an included file.  Thanks in advance for any
help you can provide!

Jen Perkins
Macromedia Certified ColdFusion Developer
Carol/Trevelyan Strategy Group
http://www.ctsg.com/

Kumbaya, Dammit!
http://www.kumbayadammit.com/



-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 5:53 PM
To: CF-Talk
Subject: RE: Cookie disappears when browser closes!


whats the url?
whats the code look like?

....tony

-----Original Message-----
From: Jennifer Perkins [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 9:52 PM
To: CF-Talk
Subject: Cookie disappears when browser closes!


I'm having a problem with a cookie I've set for a client's site. Server
is
CF5, and there is no cflocation tag on the page anywhere, so that's not
an
issue.

When a user votes in a poll on the site's homepage, I set a cookie. The
homepage will then display the results of the poll instead of the poll
itself, to prevent users from voting mutliple times in a poll. The
cookie is
just fine after it's set...until I close the browser window. Then it
disappears. I can navigate around the site, to other sites, etc., no
problem - it only goes away when the browser window is closed.

I've tried setting the "domain" attribute for the tag, but that did not
affect anything. The "expires" attribute is currently set to
"12/31/2020"
although I had it set to "never" before, and that didn't work either.

I've lowered my privacy settings on MSIE to "low", thinking it might be
an
issue with my browser (previously set at "medium") but that doesn't help
either.

Any ideas?


Jen Perkins
Macromedia Certified ColdFusion Developer
Carol/Trevelyan Strategy Group
http://www.ctsg.com/

Kumbaya, Dammit!
http://www.kumbayadammit.com/







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to