Set Cookie using htaccess

Header set Set-Cookie "language=%{lang}e; path=/;" env=lang

Set Cookie based on Request. This code sends the Set-Cookie header to create a cookie on the client with the value of a matching item in 2nd parentheses.

RewriteEngine On
RewriteBase /

RewriteRule ^(.*)(de|es|fr|it|ja|ru|en)/$ - [co=lang:$2:.yourserver.com:7200:/]


Set Cookie using htaccess Dev2Tricks 5 of 5
Header set Set-Cookie "language=%{lang}e; path=/;" env=lang Set Cookie based on Request. This code sends the Set-Cookie head...

Share this

Related Posts

Previous
Next Post »