alm
Version:
The best IDE for TypeScript
15 lines (14 loc) • 653 B
JavaScript
;
/**
* Gets / sets the client session id using the url
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSessionId = function () { return window.location.hash.substr(1); };
exports.setSessionId = function (sessionId) {
// http://stackoverflow.com/questions/12381563/how-to-stop-browser-back-button-using-javascript
var hash = '#' + sessionId;
window.location.hash = hash;
window.location.hash = "Again-No-back-button"; // again because google chrome don't insert first hash into history
window.location.hash = hash;
window.onhashchange = function () { window.location.hash = hash; };
};