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 .
Amit KumarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
What browser are you using?  Chrome will not accept a cookie on 'localhost'.  You have to be at least using the machine IP address if not a domain name.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.