0
Set-Cookie 함수를 사용하고 있습니다. 크롬과 파이어 폭스에서 잘 작동합니다.IE에서 Set-Cookie가 작동하지 않습니다
쿠키를 설정하면 불그스프로 볼 수 있습니다.
하지만 뭔가 잘못하고 있어요 경우 어떤 이유로 내 구문이 올바른지 사람이 확인할 수 있습니다 즉
에서 쿠키를 설정하거나되지
?function generateSession($cookieName="wic_secure_sess", $idTag="", $numChars=32, $expireSeconds=0, $path=null, $domain=null, $secure=2) {
if (!isset($_COOKIE[$cookieName])) {
$sessId = $idTag;
for ($i=0; $i<$numChars; $i++) {
srand((double)microtime()*1000000);
$randomType=rand(1, 3);
srand((double)microtime()*1000000);
switch ($randomType) {
case 1:
$sessId.=chr(rand(65, 90));
break;
case 2:
$sessId.=chr(rand(97, 122));
break;
case 3:
$sessId.=rand(0, 9);
break;
}
}
$expires = str_replace('+0000', 'GMT', gmdate('r', strtotime('+30 days')));
if ($expireSeconds != 0) {
$expireSeconds = time()+$expireSeconds;
}
if (livecheck() || stagecheck()) {
header("Set-Cookie:". $cookieName."=".$sessId."; expires=".$expires."; path=".$path.";HttpOnly;secure;");
}
else {
header("Set-Cookie:". $cookieName."=".$sessId."; expires=".$expires."; path=".$path.";HttpOnly");
}
} else {
$sessId = $_COOKIE[$cookieName];
}
return $sessId;
}
?>
I dont want to use setcookie() because i am running php4 version since php4 does not support httponly in the setcookie() function
편집 : php setcookie() 함수는 IE에서 완벽하게 작동합니다. 때 헤더() 문제를 만드는 thats 사용합니다.
generateSession("my_sess", "", 20, 14400, "/");