I have a doubt about how to manage a user's session in React, for example in MVC .NET you only just do this using the Session object (e.g. Session["test"] = "";
), but obviously React can not do this.
I was reading about using the component state, I suppose that sets the state at the principal component and passes this state to other components using props. Also I saw people recommending the use the browser's localStorage
or cookies, but I don't know if this if a good idea or practice.
Is there a better way to manage sessions variables in React than localStorage
or cookies?