Apache MOD_REWRITE Domain Level Cookie
Posted
by
BigMadKev
on Stack Overflow
See other posts from Stack Overflow
or by BigMadKev
Published on 2008-10-23T09:30:08Z
Indexed on
2010/12/26
12:53 UTC
Read the original article
Hit count: 240
I need to deal with Affiliate Tracking on our website.
In our .htaccess we have:
RewriteCond %{QUERY_STRING} affiliate=(.*)
RewriteRule ^(.*)$ $1? [NC,R,L,co=AFFID:%1:%{HTTP:Host}:7200:/]
Which creates a COOKIE called AFFID with the value of the URL Parameter affiliate.
But the Cookie is not for the whole domain, i.e. Going to http://www.domain.com/?affiliate=bmk sets the AFFID cookie with the value bmk for .www.domain.com but I would like ti to be for .domain.com so that it can be used across our secure domain which will be secure.domain.com
Any help would be appreciated
Cheers
© Stack Overflow or respective owner