1

I have created excel add-ins using office.js and react-fabric UI. I wants to use sessionStorage to keep logged in user information for session management. On office365 online version it is working as expected but when it comes with native desktop excel sessionStorage.getItem(key) returning null.

Basically the intention to use sessionStorage as we have requirement for multiple user can login in to application from different tabs on same browser and to manage session for multiple user trying to use sessionStorage. And if I use localStorage then same user info is getting available for all browser tabs and if we close the tab and open it again then also same user info is getting shown which is as per the browser storage API.

Please help is there any way to resolve this issue or any alternative for sessionStorage where I can keep user info to manager user session or how we can enable sessionStorage on desktop excel?

1
  • can anyone please help? Commented Jul 30, 2021 at 16:34

1 Answer 1

0

With sessionStorage, you cannot share data across browser tabs because each tab has its own session (as described here). The other option would be localStorage, but in this case the data stored inside has no expiration and it is accessible from any tab, like you mentioned.

An alternative would be to use cookies - you can set expiration (via max-age attribute) and you can also delete them when no longer needed.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Dharman, Will check with cookie implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.