Anders Fejerskov
Anders Fejerskov

Reputation: 55

Firefox use the "restore last session" function on web application

I want to use the "Restore last session" function in firefox, on my own customized homepage.
I just can't find any information on how to use the function, if it is even possible.

so:

  1. Is it possible to use the restore last session on a webpage?
  2. if it is, how? javascript, php, html?

Upvotes: 4

Views: 274

Answers (3)

Esben Tind
Esben Tind

Reputation: 885

Sounds like you need cookies to me. If the session has run out you can refresh it from the clients (in this case, your) cookie.

To manipulate with firefox feature through a website, you need to make a plugin for firefox, which can then listen for certain javascript commands. At least as far as I am aware. Info on the session store API can be found here.

HTML5 webstorage could also be the way to go, as previously stated.

I dunno, I like cookies :)

Upvotes: 0

Joseph
Joseph

Reputation: 119847

errr.. cookies? webstorage? plus JavaScript? ring any bells? just google how they work, and you can assemble one yourself.

Overview

cookies are bite-sized pieces of data (hence "cookies". I think they are just 4KB in size), that you can store bits of info about a session. on modern browsers, there is what you call a web storage, specifically the localstorage. it's bigger than cookies (5MB on Chrome, 10MB on the others).

both these resources are accessible via JavaScript but only cookies are naturally seen by PHP since they are sent with the request headers. with these storage options plus a bit of JS/PHP manipulation, you can return to your "last session"

but note about security also. both storages are visible to scripts as well as debuggers. firefox treats localstorage as cookies, chrome treats them as cache. don't put sensitive content in them. I suggest you place "markers" instead, indicators to a database record. then have a database store the real session info instead. that way, only the server knows where and what you did.

Upvotes: 1

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114377

Firefox's feature it is not something you can script with your web page.

However you can use HTML5 storage to save the "state" of a page and restore it later, but it's not an out-of-the-box solution. You'd have to script it all yourself.

Upvotes: 3

Related Questions