Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE8 setting cookies

Status
Not open for further replies.

jesse1

Programmer
Aug 29, 2008
30
0
0
US
The following code works in IE7 and down but fails to set a cookie in IE8. Is anyone familiar with this problem.


Code:
<cfoutput>
    	<cfif url.sprok eq 2>      
           <cfcookie name = "sp"  >
           <cfcookie name = "sp" value = "#url.sprok#" expires = "never" >
	<cfelse>
	   <cfcookie name = "sp" value = "#url.sprok#"  >
      	</cfif>
</cfoutput>
 
sounds like a client security setting in IE8 not to accept cookies.

The cfoutput tags are not required in this application.

make sure you do not do a cflocation after you set cookies.

Vegans are friends, not food...
 
Also: while it might evaluate correctly the url variables are strings. <cfif url.sprok eq 2> sb <cfif url.sprok eq '2'>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Technically CFML is weakly typed so unless you want to cast every variable there's nothing wrong with that.

Code:
<cfset a = "1">
<cfset b = 2>
<cfset c = "3">
<cfoutput>
"a"+b = #a+b#
<br />
"a"+"c" = #a+c#
<br />
</cfoutput>
output:
Code:
a+b = 3
a+c = 4


Vegans are friends, not food...
 
IE8 does not like the first line in the if statement:
<cfcookie name = "sp" >

I must left it their by mistake but it only causes problems in IE8

The following code works fine.

Code:
<cfoutput>
      <cfif url.sprok eq 2>      
         <cfcookie name = "sp" value = "#url.sprok#" expires = "never" >
    <cfelse>
       <cfcookie name = "sp" value = "#url.sprok#"  >
          </cfif>
</cfoutput>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top