views:

60

answers:

2

Hi,

I'm trying to build a site that does not rely on the user enabling 3rd party cookies.

For some reason, I'm noticing null $_POST variables from a simple only in Firefox and Chrome when 3rd party cookies are blocked (IE is fine). This is only with POST. The GET variables from the same script store the data normally.

I have set IE privacy to "high" so that it "blocks all cookies without a privacy policy" and that still allows my POST data to work normally, probably because I have a privacy policy on every page.

And when I'm in FF or Chrome and uncheck "block 3rd party" cookies, then it's fine. I get the usual values I expect when I access $_POST['foo'].

Does anyone have a clue what may be going on and how to retrieve form data using POST in this situation? My code is below.

Thanks.

 <form id="submission" enctype="plain" name="submission" method="post" action="../index.php?pub_path=<?php echo $path;?>" >
  <input type="text" id="pubcomments" name="pubcomments" ></input>
  <input type="submit" id="postIt" value="Post to forum"></input>

index.php:

if (isset($_GET['pub_path'], $_POST['pubcomments'])) {

  $path = $_GET['pub_path'];  //shows the path

  $comment = $_POST['pubcomments']; // $comment is null


} 
A: 

I removed the enctype=plain and still have the same bug. I believe it is a cookie issue because in other forms throughout my site, the POST variables are not getting set when I check the values in the script. So it's not just in one place, it's everywhere throughout my site. And this problem of having null POST variables disappears when I enable 3rd party cookies in all browsers.

shellzie
A: 

Hmm still have the same issue. I tried passing the pubcomments and pub_path (hidden text) in the form. Both post values are getting sent according to the "Post data" tab in HTTPFOX but I'm seeing "Error loading content (NS_ERROR_DOCUMENT_NOT_CACHED)" and a 302 error.

I'm making a facebook application and wondering if this error is due to the fact that the url referenced in the form's "action" property is different from www.facebook.com where the page is rendered.

Anyone know if it's even possible to create a facebook app with the iframe method and have it work with 3rd party cookies blocked?

shellzie