Home > other >  Use gin framework, every time after the restart the server can't log in, only clear the cookies
Use gin framework, every time after the restart the server can't log in, only clear the cookies

Time:11-20

Use gin framework, every time after the restart the server can't log in, only to clear cookies to log in, any way to change this situation?
And I found that don't seem to clear the cookie is responsible for reading the cookie and comparing middleware doesn't perform,
Another cookie general train of thought is
1, log in successfully, to write information into the session and cookies, cookies are saved to the local
2, and access other pages from the local cookies to be obtained, then the session information and the server, if by entering to access the page, not through the jump to the login page
Should be the idea?

CodePudding user response:

Gin framework don't know, but I am a recent project with aws propagated and Cognito authentication way, and you similar occur,
Then the solution is on my side in the code to delete cookies
Work may be similar and propagated to estimate the gin, own also have a session cookie management, which stores the background of the session, as long as its own session cookie alive (that is, you don't delete the cookie), it will continue to use the original save the background of the session (as long as it has not expired) to access the background, but because you the background to restart, so did not have the background of the session, and gin itself to save the background session exists, so it won't be redirected to the login, in with the old session to access the background, and then make a mistake,
  • Related