Quote:
Originally posted by magnatique
is there any way I can verify if session cookies are enabled on a user's browser?
|
Do this :
PHP Code:
<?php
$ref = $_SERVER['PHP_SELF'];
setcookie("test","working");
header ("Location: http://www.yourserver.com/verify_cookies.php?ref=$ref");
exit;
?>
Paste that anytime you wanna verify if cokkies are enabled.
Then save this as a file named verify_cookies.php :
PHP Code:
<?php
$ref = $_GET['ref'];
$test_cookie = $_COOKIE['test'];
if ($test_cookie == "working") {
header ("Location: http://www.yourserver.com/$ref");
} else {
header ("Location: http://www.yourserver.com/youaintgotnocookies.php");
}
exit;
?>
Make modifications where needed.
Rory
Edit: Parse URLs doesnt work too well in code