ENHANCEMENT 'bypassStaticCache' cookie set in Versioned is limited to httpOnly flag (no access by JS) to improve clientside security

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114568 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-12-06 00:29:20 +00:00
parent 562eeee790
commit 1222b4d146

View File

@ -693,9 +693,9 @@ class Versioned extends DataObjectDecorator {
if(!headers_sent()) {
if(Versioned::current_stage() == 'Live') {
Cookie::set('bypassStaticCache', null, 0);
Cookie::set('bypassStaticCache', null, 0, null, null, false, true /* httponly */);
} else {
Cookie::set('bypassStaticCache', '1', 0);
Cookie::set('bypassStaticCache', '1', 0, null, null, false, true /* httponly */);
}
}
}