[livejournal] r17444: LJSUP-6969: Some lj.com sub-domains shou...
Committer: vsukhanov
LJSUP-6969: Some lj.com sub-domains should not send ljuniq cookieU trunk/cgi-bin/LJ/UniqCookie.pm
Modified: trunk/cgi-bin/LJ/UniqCookie.pm
===================================================================
--- trunk/cgi-bin/LJ/UniqCookie.pm 2010-09-24 07:44:55 UTC (rev 17443)
+++ trunk/cgi-bin/LJ/UniqCookie.pm 2010-09-24 09:17:36 UTC (rev 17444)
@@ -382,7 +382,18 @@
return unless LJ::is_web_context();
return unless LJ::Request->is_inited;
-
+
+ ## do not set cookie from some domains:
+ ## stat, l-stat
+ ## files,
+ ## userpic, l-userpic
+ ## ...
+ ## these are domains with public, mostly static content.
+ ##
+ my $domain = LJ::Request->header_in("Host");
+ my ($subdomain) = $domain =~ m|^(.+?)\.\Q$LJ::DOMAIN\E|;
+ return if $subdomain and $LJ::COOKIE_FREE_DOMAINS{$subdomain};
+
my ($uniq, $uniq_time, $uniq_extra) = $class->parts_from_cookie;
# set this uniq as our current
