Although not being exactly sure if this is a react specific question:
We are developing and application using react/redux stack with server side rendering. After user logs in we receive two cookies one for identity and one for session in the browser (with an expiration date). The problem is when the user refreshes the page the state is getting reset and we lose our session information ( we basically set some variables in the state to indicate the user is logged in ).
The question is how to manage this situation and keep the user logged in even when the page is refreshed. I am thinking of keeping server side rendering completely out of the picture and just check on the client side for a non-expired session id cookie when the page is initially rendered and set some variables in the state if the session is still alive, and vice-versa otherwise.
Does this look like a secure approach? Is there a better way to do it?