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['frontd oor'])) {
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 .
example below:
RewriteEngine On
RewriteRule ^index\.php - [CO=frontdoor:yes:.example
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['frontd
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.