How to signup in reactjs by storing JWT token in the cookies such that whenever a user signs in then he/she is automatically logged in?
I am developing a chat app using MERN stack. I have stored jwt token in the cookies in the backend part to signup and login and it is working correctly. Whenever a user signs up then he is automatically logged in. I want to implement similar functionality in the frontend (reactjs) where whenever a user signs in then he is logged in automatically and when a user logins manually then a new JWT token is created and stored in the cookies.