diff --git a/src/definitions/modules/nag.js b/src/definitions/modules/nag.js index 061953fc0..6dc4cd627 100644 --- a/src/definitions/modules/nag.js +++ b/src/definitions/modules/nag.js @@ -194,6 +194,10 @@ $.fn.nag = function(parameters) { window.localStorage.setItem(key, value); module.debug('Value stored using local storage', key, value); } + else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) { + window.sessionStorage.setItem(key, value); + module.debug('Value stored using session storage', key, value); + } else if($.cookie !== undefined) { $.cookie(key, value, options); module.debug('Value stored using cookie', key, value, options); @@ -210,6 +214,9 @@ $.fn.nag = function(parameters) { if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) { storedValue = window.localStorage.getItem(key); } + else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) { + storedValue = window.sessionStorage.getItem(key); + } // get by cookie else if($.cookie !== undefined) { storedValue = $.cookie(key); @@ -229,6 +236,9 @@ $.fn.nag = function(parameters) { if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) { window.localStorage.removeItem(key); } + else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) { + window.sessionStorage.removeItem(key); + } // store by cookie else if($.cookie !== undefined) { $.removeCookie(key, options);