diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-22 19:04:29 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-22 19:04:29 +0000 |
commit | de7a31daaef62f2e89dfdae767e4061bfbbf576a (patch) | |
tree | 230922434057ad572d12e886377cd2abb39050bf /perllib/Catalyst | |
parent | 8ce92aa814d69fbdb221483450b95ca2d9267bce (diff) |
Don't send cookie on JS files, as can cause session loss.
Diffstat (limited to 'perllib/Catalyst')
-rw-r--r-- | perllib/Catalyst/Plugin/Session/State/Cookie.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/Catalyst/Plugin/Session/State/Cookie.pm b/perllib/Catalyst/Plugin/Session/State/Cookie.pm index c4b61123b..7c9f32878 100644 --- a/perllib/Catalyst/Plugin/Session/State/Cookie.pm +++ b/perllib/Catalyst/Plugin/Session/State/Cookie.pm @@ -50,6 +50,9 @@ sub update_session_cookie { sub cookie_is_rejecting { my ( $c, $cookie ) = @_; + # Don't output cookie for JS files. mySociety addition + return 1 if substr $c->request->path, -3 eq '.js'; + if ( $cookie->{path} ) { return 1 if index '/'.$c->request->path, $cookie->{path}; } |