HTML5's sessionStorage vs. WinJS' sessionState RRS feed

  • Question

  • Hello everybody,

    is there a guideline when to use which API? From my understanding, sessionStorage and sessionState are conceptually quite similiar. They deviate in some places, e.g. sessionStorage's "restore session" feature. Is there some guideline / best practices when to use both of them?

    If the future is HTML5, I currently do not see any reason why one should use WinJS' sessionState. Any thoughts on this? Thanks!

    Best Regards

    • Edited by oarafat Friday, May 11, 2012 11:43 AM
    Friday, May 11, 2012 11:42 AM


  • Hi O,

    SessonState can be used to properly restore the state of your application as it goes through the application lifecycle.  For example, if you get suspended and then terminated by the OS, the sessionstate will resume correctly.  If the customer terminates the app, the sessionstate is flushed as if the customer started the app fresh (which they did).  If you want to duplicate this effort or change it using SessionStorage you can do that too.


    Jeff Sanders (MSFT)

    Friday, May 11, 2012 8:12 PM