Using window.sessionStorage instead of cookies + small tweaks