Setting Cookies Problem Going From A Frame And Back In IE

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have 2 'vanity' sites - the first which I wrote in ASP (let's call it Site ASP) and the second which I inherited and wrote in PHP (the host at the time didn't do ASP - let's call this one Site PHP)

Each of these two sites log in to my internally-hosted e-commerce site, from which a user can click a link to save their login details which goes out to the vanity site, sets a cookie and comes right back.

Site ASP has been working for years. Site PHP has been working for about a year with PHP but I just moved it to the same hosting company as Site ASP due to the constant outages Site PHP was experiencing and the good luck we've had with Site ASP's host. After I moved Site PHP I copied in the ASP code I use in Site ASP and have observed the following:

Running the following code from a regular (non-framed) ASP page works just fine:

WWW.ECOMMERCESITE.COM/LEFT.ASP
<form name="cookieadd" action="http://www.vanitysite.com/cookieadd.asp?C=VALUE method="Post">
<input type="hidden" name="UserID" value="<%response.Write varID%>" ID="UserID">
<input type="hidden" name="UserPW" value="<%Response.write session("UserPW")%>" ID="UserPW">
<input type="hidden" name="UserName" value="<%Response.write session("UserFirstName") & " " & session("UserLastName")%>" ID="UserName">
</form>
<a href="JavaScript: document.cookieadd.submit()" class="smallurl" size="1">Remember My Login</a>


WWW.VANITYSITE.COM/COOKIEADD.ASP
<%response.buffer=true%>
<%' To stop ASP caching
    Response.Expires = -1
    Response.Expiresabsolute = Now() - 1
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control","private"
    Response.CacheControl = "no-cache"
Response.Cookies ("SMI")("UserID") = request("UserID")
Response.Cookies ("SMI")("UserPW") =  request("UserPW")
Response.Cookies ("SMI")("UserName") =  request("UserName")
Response.Cookies ("SMI").expires = DateAdd("m",12,Now())
url="http://WWW.ECOMMERCESITE.COM/left.asp?Cookie="; & request("UserID")
Response.Write ("<script>"&vbcrlf)
Response.Write ("parent.contents.location.replace('" & url & "');" & vbcrlf)
Response.Write ("</script>")

However, while running this same code in a page that is a frame will work in Opera 7.54u2, Netscape 7.2, Mozilla 1.7.6 and FireFox 1.0.2, it will not run in IE6 - IE comes right back to LEFT.ASP as if it's done its thing but no cookie is ever set.

I have tested this further by having a straight link to a URL on the vanity site that sets a cookie with hard-coded values and comes right back to the calling page. This produces the same results - fine if it's in a non-framed page, doesn't write the cookie if it's in a frame.

To add to the confusion, the code works flawlessly on the other site, hosted on the same host but presumably on another server and very likely on a different version of Apache with Sun's ASP extensions.

Does anyone have any suggestion as to how to what might be going on and more importantly, how to fix it?

Thanks,
Alex
.



Relevant Pages

  • Re: How do I insert a cgi script into Publisher page?
    ... As you were working out your PHP form, did you happen to run across this ... My host is www.swissnetsolutions.ch and yes, ... I was told that they do not have a cgi form ... Though Publisher uses 'ISP' I think that may be confusing to some ...
    (microsoft.public.publisher.webdesign)
  • Re: working with mysql
    ... throw new Exception('Error connecting to host. ... I would like to be able to get php to pull the data. ... Did you take out your throw statement and put in the echo like I asked? ...
    (comp.lang.php)
  • Re: Publisher 2000, php and more
    ... > Don't know about creating web pages with 2000, but I do know my web host ... I have resisted changing to FrontPage or more suitable ... >> My current website host does not allow FrontPage extensions, ... >> but also think I would like to start incorporating PHP, ...
    (microsoft.public.publisher.webdesign)
  • Re: Transfering Website, PHP Configuration
    ... My client wants to transfer their site from a Linux server to ... files,and what configurations need to be made in order to do the ... Your new host probably has a control panel (if they ... Sure this has to do with PHP. ...
    (comp.lang.php)
  • Re: Transfering Website, PHP Configuration
    ... My client wants to transfer their site from a Linux server to ... files,and what configurations need to be made in order to do the ... Your new host probably has a control panel (if they ... Sure this has to do with PHP. ...
    (comp.lang.php)