# Okta store the key as value in the session storage instead of session info (JSON)

**URL:** <https://devforum.okta.com/t/okta-store-the-key-as-value-in-the-session-storage-instead-of-session-info-json/30607>\
**Category:** OAuth/OIDC\
**Tags:** authjs\
**Created:** [September 17, 2024, 5:22pm UTC](https://devforum.okta.com/t/okta-store-the-key-as-value-in-the-session-storage-instead-of-session-info-json/30607 "2024-09-17T17:22:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcs\_13](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/tcs_13/32/5663_2.png) [@tcs\_13](https://devforum.okta.com/u/tcs_13)\
**Post date:** [September 17, 2024, 5:22pm UTC](https://devforum.okta.com/t/okta-store-the-key-as-value-in-the-session-storage-instead-of-session-info-json/30607/1 "2024-09-17T17:22:37Z")

</div>

We’re experiencing an intermittent issue where the `okta-token-storage` value in session storage gets replaced by a string (the key) instead of the session information in JSON format. This causes a JSON parsing error, breaking the application.

We are not manually setting the session storage; rather, it’s being handled by the function passed to the `OktaAuth` constructor in `tokenManager.storage`, which is responsible for setting session storage items.

Lib used:  
“@okta/okta-auth-js”: “^4.2.0”,  
“@okta/okta-react”: “^4.0.0”,

React:  
“react”: “^18.2.0”,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [October 17, 2024, 5:22pm UTC](https://devforum.okta.com/t/okta-store-the-key-as-value-in-the-session-storage-instead-of-session-info-json/30607/2 "2024-10-17T17:22:39Z")

</div>

Closed on October 17, 2024, 5:22pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
