Skip to content

Instantly share code, notes, and snippets.

@dmamolina
Created June 21, 2013 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmamolina/9e1413ed11fb9f62a8d7 to your computer and use it in GitHub Desktop.
Save dmamolina/9e1413ed11fb9f62a8d7 to your computer and use it in GitHub Desktop.
Fix selfservice cookie expiration
diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js
index e253214..bda9e17 100644
--- a/src/sunstone/public/js/sunstone.js
+++ b/src/sunstone/public/js/sunstone.js
@@ -296,10 +296,24 @@ $(document).ready(function(){
setLogin();
setInterval(function(){
- var user_cookie = cookie["one-user"];
- readCookie();
- if ((cookie["one-user"] == null) || (cookie["one-user"] !== user_cookie)) {
- window.location.href='/';
+ if (whichUI() == "sunstone") {
+ var user_cookie = cookie["one-user"];
+ readCookie();
+ if ((cookie["one-user"] == null) || (cookie["one-user"] !== user_cookie)) {
+ window.location.href='/';
+ }
+ } else if (whichUI() == "selfservice") {
+ var user_cookie = cookie["occi-user"];
+ readCookie();
+ if ((cookie["occi-user"] == null) || (cookie["occi-user"] !== user_cookie)) {
+ window.location.href='/';
+ }
+ } else if (whichUI() == "ozones") {
+ var user_cookie = cookie["ozones-user"];
+ readCookie();
+ if ((cookie["ozones-user"] == null) || (cookie["ozones-user"] !== user_cookie)) {
+ window.location.href='/';
+ }
}
},5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment