My website uses cookies and smarty. When logging out, the cookie is cleared, but the nickname is not updated. {Code...} My website uses cookies and smarty.
When logging out, the cookie is cleared, but the nickname is not updated.
<{If $ username! = "" }> Hello, <{$ nick_name }>< {/if}>
Reply content:
My website uses cookies and smarty.
When logging out, the cookie is cleared, but the nickname is not updated.
<{If $ username! = "" }> Hello, <{$ nick_name }>< {/if}>
In the comments, the po master registered an account for the website and tried it.
The purpose of the visual test is that the server sends the page content before clearing the cookie. As a result, the client contains the previous logon status information on the response result page of the cookie clearing.
Solution:
1. log out with an asynchronous request, and then jump to/refresh the page.
Or:
2. Jump to a logout url and let the browser jump back to the home page in the returned content.
Er... It feels a little messy... If you have any questions, ask me.