Skip to content

Commit 58455c0

Browse files
author
Jessica Wang
committed
CLOUDSTACK-7809: UI > remove usage of g_mySession which is unnecessary.
1 parent 070e689 commit 58455c0

2 files changed

Lines changed: 4 additions & 29 deletions

File tree

‎ui/scripts/cloudStack.js‎

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,6 @@
9393
message: parseXMLHttpResponse(data),
9494
clickAction: clickAction
9595
});
96-
},
97-
beforeSend: function(XMLHttpRequest) {
98-
if (g_mySession == $.cookie("JSESSIONID")) {
99-
return true;
100-
} else {
101-
var clickAction = function() {
102-
$('#user-options a').eq(0).trigger('click');
103-
};
104-
105-
if ($('.notification-box:visible').size()) {
106-
$('.notification-box, div.overlay:first').remove();
107-
}
108-
109-
cloudStack.dialog.notice({
110-
message: _l('label.session.expired'),
111-
clickAction: clickAction
112-
}).closest('.ui-dialog').overlay();
113-
114-
return false;
115-
}
11696
}
11797
});
11898

@@ -137,7 +117,6 @@
137117
}
138118
return cookieValue;
139119
};
140-
g_mySession = $.cookie('JSESSIONID');
141120
g_sessionKey = unBoxCookieValue('sessionKey');
142121
g_role = unBoxCookieValue('role');
143122
g_userid = unBoxCookieValue('userid');
@@ -147,7 +126,6 @@
147126
g_userfullname = unBoxCookieValue('userfullname');
148127
g_timezone = unBoxCookieValue('timezone');
149128
} else { //single-sign-on (bypass login screen)
150-
g_mySession = $.cookie('JSESSIONID');
151129
g_sessionKey = encodeURIComponent(g_loginResponse.sessionkey);
152130
g_role = g_loginResponse.type;
153131
g_username = g_loginResponse.username;
@@ -238,8 +216,7 @@
238216
async: false,
239217
success: function(json) {
240218
var loginresponse = json.loginresponse;
241-
242-
g_mySession = $.cookie('JSESSIONID');
219+
243220
g_sessionKey = encodeURIComponent(loginresponse.sessionkey);
244221
g_role = loginresponse.type;
245222
g_username = loginresponse.username;
@@ -335,8 +312,7 @@
335312
$.ajax({
336313
url: createURL('logout'),
337314
async: false,
338-
success: function() {
339-
g_mySession = null;
315+
success: function() {
340316
g_sessionKey = null;
341317
g_username = null;
342318
g_account = null;
@@ -347,8 +323,7 @@
347323
g_kvmsnapshotenabled = null;
348324
g_regionsecondaryenabled = null;
349325
g_loginCmdText = null;
350-
351-
$.cookie('JSESSIONID', null);
326+
352327
$.cookie('sessionKey', null);
353328
$.cookie('username', null);
354329
$.cookie('account', null);

‎ui/scripts/sharedFunctions.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
var g_mySession = null;
17+
1818
var g_sessionKey = null;
1919
var g_role = null; // roles - root, domain-admin, ro-admin, user
2020
var g_username = null;

0 commit comments

Comments
 (0)