question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prefix is not set correctly in sessionStorage

See original GitHub issue

I try to change prefix using setKeyPrefix. Everything is OK in localStorage (cicoub13-test = issue) but prefix is not set in sessionStorage (ngStorage-test = issue).

Config code :

$localStorageProvider.setKeyPrefix('cicoub13-');

Controller code :

    $scope.testLocal = function() {
        console.log('testLocal');
        $localStorage.test = 'issue';
    };

     $scope.testSession = function() {
        console.log('testSession');
        $sessionStorage.test = 'issue';
    };

Test with yo angular and version 0.3.10 of ngStorage

issue-ngstorage-prefix

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
egilkhcommented, Jun 6, 2016

Wait.

You should need to do it for both $localStorageProvider and $sessionStorageProvider, as they are 2 different providers and services.

Can you give it a try?

$localStorageProvider.setKeyPrefix('cicoub13-');
$sessionStorageProvider.setKeyPrefix('cicoub13-');

And see if that doesn’t fix it for you?

0reactions
phongca22commented, Sep 25, 2017

Please note them into Document.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML5 Local Storage URL Prefix - javascript - Stack Overflow
The problem is localSotrage is working on www.mydomain.com but the thing is it is not working when i go to www.mydomain.com/myarticle. Is there ......
Read more >
JSDoc: Namespace: storage
Creates a session storage object that scopes all the keys using a prefix "Acme" and the application id. It then sets and gets...
Read more >
Variable Prefixes | CpExtra Help - Infosemantics
Any variable whose name starts with SS_ (not case sensitive) will be treated as a session storage variable. Session storage is similiar to...
Read more >
sessionStorage fails with security error when cookies are set ...
sessionStorage fails with security error when cookies are set to "ask every time" (NS_ERROR_DOM_SECURITY_ERR exception)
Read more >
Browser - MarketSquare
Compared to Selenium, these do not require their own browser process. ... The explicit selector strategy is specified with a prefix using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found