Friday, August 13, 2004

[Web] IE Logging at psuthaiclub.net FiXED

I successfully fixed the log in problem on IE browser.
The solution came from the site : http://nukecops.com/posttic5219-0-log+status+offline+problem-60.html.

The key step is to add this line:

header("P3P: policyref=\"http://psuthaiclub.net/phpnuke\"\, CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"");

This fixes the cookie accaption policy in IE. Normally, if you use url forwarding to Nuke page, cookie from that page will be counted as 3rd party cookie (and of course, it requires user identity). Then, IE misunderstands the page; it thinks that the page is in unsafe web site. Thus, we need to tell it to use compact policy and it will accept the cookie.

The file that we need to fix is mainfile.php and the hot spot is look like this.

.....
require_once("includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
}

//P3P Compact Privacy Policy (Generator Used from http://p3pedit.com/)
header("P3P: policyref=\"http://psuthaiclub.net/phpnuke\"\, CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"");

$mainfile = 1;
$sql = "SELECT * FROM ".$prefix."_config";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

...............

What a graceful solution.
Hail to you, Mikron.

No comments: