Code review comment for lp://staging/~gary/juju-gui/noCookiesAgain

Revision history for this message
Gary Poster (gary) wrote :

Reviewers: mp+186649_code.launchpad.net,

Message:
Please take a look.

Description:
Fix no-cookie access. Again.

test suggestions welcome. I don't see any practical ones.

https://code.launchpad.net/~gary/juju-gui/noCookiesAgain/+merge/186649

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/13786044/

Affected files (+8, -4 lines):
   A [revision details]
   M app/store/env/base.js

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: app/store/env/base.js
=== modified file 'app/store/env/base.js'
--- app/store/env/base.js 2013-09-02 11:24:20 +0000
+++ app/store/env/base.js 2013-09-19 20:29:59 +0000
@@ -62,11 +62,13 @@
     * @return {undefined} side effects only.
     */
    module.verifySessionStorage = function() {
- if (!module.sessionStorage) {
- // The conditional is to allow for test manipulation.
- module.sessionStorage = window.sessionStorage;
- }
      try {
+ // Any manipulation of the sessionStorage that might actually fail
+ // because cookies are turned off needs to be in this try/catch
block.
+ if (!module.sessionStorage) {
+ // The conditional is to allow for test manipulation.
+ module.sessionStorage = window.sessionStorage;
+ }
        module.sessionStorage.getItem('credentials');
      } catch (e) {
        module.sessionStorage = module.stubSessionStorage;

« Back to merge proposal