Closed saniko closed 6 years ago
Right now the only thing I am storing is the auth access token, I stored it in a cookie as I need it in the server too
So my flow is: user log in -> save access token to cookie -> user refresh page -> browser sends the cookie to server -> on the server I get the access token from cookie -> fetch data from my api using the token -> render everything -> dump all the state to html -> send html+state to client -> react is happy with no html mismatch
I used redux but I used express session and when the user logged in I store the data in a session Then I checked if the session data was available before creating the store. If it was use that otherwise use some default state.
Hi, What is the best approach to store data in session? I'm using mobx as a store, and would like to be able to set and retrieve data between browser refreshes. Obviously, I cannot use sessionStorage.
What are guys doing? using 'config' for this or some CLIENT variable?
Thanks.