I have a templete using cfcookie in my development folder and it works find. When I copy it up to the public folder and put it on the internet, it will not pass the cookie.
Any ideas why?
What's your code look like? Are you setting an incorrect domain once it gets to the live server? Does your Application.cfm file look the same (the CFAPPLICATION tag)?
I pass a variable (button) from the previous page. On the second page, I have
<cfif button is yes>
<cfcookie name="view" value="1" expires="1">
</cfif>
At this point, it is fine(meaning #view#=1).
But whenever I hit a button on this page, I get an error saying that #view# is not defined.
This only happens on the live server.
I dont know what you mean by "setting an incorrect domain"
My application.cfm file looks nothing at all like the template in question.
Have you tried a very simple testing file? Make a file where all it does is set a cookie, then make another one that only checks and outputs the value of that cookie. Try both files on both servers.
I would also try
Code:
<cfif FORM.button IS "yes">
though I'm not sure if that's what your code is asking. Is "button" a form variable from the page before? Is it's value "yes"?
I see you're not setting the domain in your
Code:
CFCOOKIE
tag, so you don't have to worry about the domain stuff.
I would first make sure your set of test files works. If they work and set your fake cookie on both servers, then something isn't working in your code. Let me know!
Yep, that code should work just fine. So something is different on the new server. I looked around and found the following tips:
- If the date/time is not set correctly on the new server you may be setting cookies that immediately expire. I don't think that's it but it's worth checking.
Hate to say it Lotruth but I think I'm at the end of my help with this one! My advice is to post the code for those two pages that you just posted, and tell them the symptoms. No reason I can think of why those test pages shouldn't work. Might also help your cause to make the testing pages live that don't work for you, so others can test them and give you their results.
Sorry! Let me know what happens, I'm interested...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.