How do I use session variables with localstorage plugin

0 favourites
  • 9 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • since the webstorage plugin was replaced by localstorage plugin

    how do i store session variables with localstorage plugin?

    yes i only want these variables to last for a session.

  • 'Session storage' has been removed in the new plugin, since it had no benefits over using global variables and added a lot of baggage.

  • benefits,I beg to differ,

    If i want a login session to only last a session, meaning when user exits browser the session should be gone.

    how can this be solved with localstorage global variables?

  • why would you need to store anything?

    Wouldn't using/setting a global variable do the job?

    When restarting all global variables are reset to their original values..

  • why store values?

    i need to pass data between 2 apps without query strings.

    i need to store data since another app will read the value t so no global variable will work.

  • Ok..

    I've never read about one app being able to read the webstorage from another..

    But if needed that way, wouldn't resetting the local storage on end of session work?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • althogh that might work technically, you kinda miss the point of html5 webstorage ,

    as when the browser is closed (and you cannot do any error handling) all session storage is removed as the session dies when browser is closed.localstorage however your data isn't removed.

    my point is that scirra removed support for 1 plugin in favour of one without the same functionality.

    as the old webstorage plugin wore perfectly for me , i'm trying to figure out why it was removed if not the same functionality is offered.

  • Like I said, this is the reason Scirra gave:

    'Session storage' has been removed in the new plugin, since it had no benefits over using global variables and added a lot of baggage.

  • my argument is that localstorage and session storage aren't the same thing,

    excerpt from scirra manual:

    "Local vs. Session storage

    The WebStorage object allows data to be stored in two places: Local storage and Session storage.

    Local storage is permanent (until the user clears their cache). If the user comes back the next day, local storage still has the saved data.

    Session storage only lasts with the current browser session. If the user comes back the next day, session storage is empty again."

    hence they removed functionality and claims it's an improvement.

    i couldnt care less if the replaced the plugin with one that has same functionality, but this wasn't the case.

    and to build functionality that is part of the html5 stack isn't really productive.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)