I want to use ajax to achieve no refreshing logon. I want to display the User Name of the current logon on the page after the logon is complete. The user name is stored in the background through session, but after each successful login, the session can only be displayed after the page is refreshed! Solution: I want to use ajax to achieve no refreshing logon. I want to display the user name currently logged on the page after the logon is complete. The user name is stored in the background through session, however, after each successful login, the session is directly blank and can only be displayed after the page is refreshed! Solutions
Reply content:
I want to use ajax to achieve no refreshing logon. I want to display the User Name of the current logon on the page after the logon is complete. The user name is stored in the background through session, but after each successful login, the session can only be displayed after the page is refreshed! Solutions
This problem should not occur. You may try to add the username and other information you need when the logon is successful.
I just want to ask you why you didn't click the new page to display the user name?
You can replace HTML code with a user name in the return value of ajax with js.
In addition, you store the user name in the SESSION in Ajax, and you cannot obtain the value without refreshing it.
After the background login verification is successful, save the username and other information of the logged-on user to the SESSION, and save a copy in the ajax return value.
Didn't you add the new value innerhtml to the user name location?
The specific description is as follows.
Put your code up and look at it. You may not be able to retrieve the value after refresh, because the session value returned by the background can be obtained after successful login, so it is your code problem. If you say so, we do not know where to start. To solve the bug, we must check the code and the feedback of the bug information to know where the specific problem is.
Thank you for your support. I have solved the problem. Thank you !!