How do I store session data between page views on a local (i.e. file://) website?
I’m trying to implement a login mechanism for a web site using JavaScript that is to be burned to a disc and run from there.
This precludes the usage of a web server, and thus, HTTP. This means that cookies are not feasible.
It appears that while Firefox and IE supports cookies on local HTML pages, Chrome and Safari do not – not surprising, given that cookies are a HTTP construct, not HTML.
Storing data on a file isn’t possible, due to the JavaScript sandbox while running within the browsers.
HTML5 localstorage/sessionstorage isn’t ideal, if only because of the fact that I’m unsure of the environment it will be running in and if it supports HTML5.
So basically, how do I track if a user is logged in on a local page without HTTP on HTML4?
Without any other options, maybe an encrypted querystring parameter that gets passed around? If it’s not in the querystring, then assume user is logged out. All pages that rely on a logged-in user will have to decrypt the value and validate each time before loading.