Skip to content

Protected namespace in localstorage #15943

Open
@sualko

Description

@sualko

Is your feature request related to a problem? Please describe.
Starting from version 16, Nextcloud deletes the complete local/sessionstorage. This can cause issues with different apps like ojsxc. I understand the intend to protect users privacy, but it would be nice if this could be configured by the app developer.

server/core/src/login.js

Lines 32 to 33 in 6f941a7

window.localStorage.clear();
window.sessionStorage.clear();

Describe the solution you'd like
Black or white list of prefixes which should be deleted or preserved. For example:

   let prefixRegex = new RegExp('^' + prefix);
   let keys = Object.keys(localStorage);

   for (let key of keys) {
      if (prefixRegex.test(key)) {
         localStorage.removeItem(key);
      }
   }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions