diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-30 15:52:07 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-30 16:47:53 +0100 |
commit | 57c1ba849c25b9397357f744df56895b250e7925 (patch) | |
tree | 315c0c77f99e2646b0aa65f2eadba523672c987c | |
parent | 577d5b0cbb759aaabeb0b56ca8ea5f2b7f9df772 (diff) |
Also don't output cookie for JPEG files to prevent session loss.
-rw-r--r-- | perllib/Catalyst/Plugin/Session/State/Cookie.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/Catalyst/Plugin/Session/State/Cookie.pm b/perllib/Catalyst/Plugin/Session/State/Cookie.pm index ead8be38d..c56206774 100644 --- a/perllib/Catalyst/Plugin/Session/State/Cookie.pm +++ b/perllib/Catalyst/Plugin/Session/State/Cookie.pm @@ -50,8 +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'; + # Don't output cookie for JS or JPEG files. mySociety addition + return 1 if substr($c->request->path, -3) eq '.js' + || substr($c->request->Path, -5) eq '.jpeg'; if ( $cookie->{path} ) { return 1 if index '/'.$c->request->path, $cookie->{path}; |