Hey, If using sessionTokenViaCookie=true in nextjs...
# ask-a-descoper
g
Hey, If using sessionTokenViaCookie=true in nextjs/react, while the project config uses session token in response body, would it override project configuration? Because I have a case where I need both (body for electron app, and cookies for web)
and a followup question - will it honor the cookie name set in flow?
a
sessionTokenViaCookie
means that the sdk (running on the browser) will store the session from body on a cookie, meaning on a JS cookie, not as an HTTP only cookie, which can be configured only by Descope service (or your backend)
and a followup question - will it honor the cookie name set in flow?
no, but you can also pass
sessionTokenViaCookie={{ cookieName: 'mycookie' }}
(this is supported on the latest version)
g
@Asaf Shen is there a way to have dual config so web system will use http only cookies while other (desktop app) will use token from body?
a
the only way to do it is to handle this on your side in other words, descope can either 1. send the cookie as an http only cookie (then it won't be available on browser) 2. send it on body you can configure to send on body, and then configure
customStorage
- there you can do whatever you want (including sending tokens to your backend and set them as http conly cookie
g
@Asaf Shen can you elaborate on customStorage? Are there any docs around that?
@Asaf Shen I’ve found the PR that added customStorage and integrated but Im afraid it doesn’t support async functionality for set/get
a
why do you need it to be async?