ui: Unbox extra quotes from sessionKey cookie value

Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9b1a6dac
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9b1a6dac
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9b1a6dac

Branch: refs/heads/master
Commit: 9b1a6dac4a4bb766ee050040356998776ddca190
Parents: 2694ad7
Author: Rohit Yadav <rohit.ya...@shapeblue.com>
Authored: Mon Aug 18 04:20:03 2014 +0200
Committer: Rohit Yadav <rohit.ya...@shapeblue.com>
Committed: Thu Aug 28 19:45:21 2014 +0200

----------------------------------------------------------------------
 ui/scripts/cloudStack.js | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b1a6dac/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index b6dd559..420c137 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -131,6 +131,13 @@
            */
                     g_mySession = $.cookie('JSESSIONID');
                     g_sessionKey = $.cookie('sessionKey');
+                    // Unbox quotes from sessionKey cookie value
+                    if (g_sessionKey[0] === '"' && 
g_sessionKey[g_sessionKey.length-1] === '"') {
+                        g_sessionKey = g_sessionKey.slice(1, 
g_sessionKey.length-1);
+                        $.cookie('sessionKey', g_sessionKey, {
+                            expires: 1
+                        });
+                    }
                     g_role = $.cookie('role');
                     g_username = $.cookie('username');
                     g_userid = $.cookie('userid');

Reply via email to