Link to home
Start Free TrialLog in
Avatar of Amit Kumar
Amit Kumar

asked on

htaccess rewriterules cookies

I want to understand how cookies crumble with rewriterules
example below:

RewriteEngine On
RewriteRule ^index\.php - [CO=frontdoor:yes:.example.com:1440:/]
1.
if I resides .htaccess file with the code into the root directory e.g. http://localhost/ (or Applications/AMPPS/www) and access http://localhost/index.php with following code :

<?php
session_start();

echo $_SESSION['frontdoor'];

if(!isset($_COOKIE['frontdoor'])) {
    echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
    echo "Cookie '" . $cookie_name . "' is set!<br>";
    echo "Value is: " . $_COOKIE[$cookie_name];
}
?>

I do not see any cookie named frontdoor ,

2. if I change domain name .example.com with localhost ? though no luck yet ,
I found very little documentation about it over internet , http://httpd.apache.org/docs/2.4/rewrite/flags.html seems a bit too little .
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial