142
Views
7
Comments
[Local Storage] ClearAllLocalStorage - clears roles?
Question
local-storage
Mobile icon
Forge asset by Paulo Cação

Hi -

Doing some tests with this, when we call "ClearAllLocalStorage", the user remains logged in (I think) but they have no roles anymore, and they need to re-login to get their roles back.

Any idea what could be happening here? I tested in a fresh module.

Thanks!

J.Ja

2025-01-07 17-06-54
Paulo Cação
Champion

Hi Justin,

When we use ClearAllLocalStorage we will clear your local variables, this is not related with session:

Regards

2019-11-12 17-31-26
Justin James
 
MVP

Paulo Cação wrote:

Hi Justin,

When we use ClearAllLocalStorage we will clear your local variables, this is not related with session:

Regards


Paulo -

I have confirmed beyond any doubt that this caused the problem (made a test Module in a brand new application). Could the issue be that it is a Reactive Web app? Or maybe a platform update made this happen? We are on the latest, 11.8.

J.Ja

2025-01-07 17-06-54
Paulo Cação
Champion

Hi Justin,

I will try check this behavior asap. Maybe the rules are saved in local storage var (or something like that), and when we clear the local storage vars, the user roles are cleared also.


Regards

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

OutSystems stores various data in different Local Storage keys for PWA, including User Role Information in the data attribute of $OS_Users$RolesInfo key.

I would say that the component should not remove any $OS_ variable from local storage.

Regards,

Daniel

2020-03-16 11-12-15
André Gonçalves
Staff

Hi Daniël, 

This component uses the localStorage API available in each browser. The ClearAllLocalStorage action calls the localStorage.clear() method and so it clears all keys in the storage.

I guess that what we can do is before clearing the storage make a copy of all $OS_ variables and then set them again... That or just remove the ClearAllLocalStorage action and allow only to remove one key at a time. 

Thanks!

2025-01-07 17-06-54
Paulo Cação
Champion

Hi,

I have updated a new version, now you can remove all variable except the OS vars. Update the plugin and enjoy it.

Best Regards,

Paulo

2019-11-12 17-31-26
Justin James
 
MVP

Paulo Cação wrote:

Hi,

I have updated a new version, now you can remove all variable except the OS vars. Update the plugin and enjoy it.

Best Regards,

Paulo

Thanks Paulo!

J.Ja

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.