View Single Post
Old 12-11-2002, 06:25 PM  
Rory
Confirmed User
 
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
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

Last edited by Rory; 12-11-2002 at 06:27 PM..
Rory is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote