I want to use Ajax to implement a non-flush login, I want to log in after the completion of the current login on the page to display the user name, the user name in the background is through the session to store, but each login success, directly take the session is empty, only refresh the page before it can be displayed! Solutions
Reply content:
I want to use Ajax to implement a non-flush login, I want to log in after the completion of the current login on the page to display the user name, the user name in the background is through the session to store, but each login success, directly take the session is empty, only refresh the page before it can be displayed! Solutions
There should be no such problem, perhaps you can try to return login success together with the user name you need to add information.
I just want to ask you how do you not refresh the page display user name?
You can replace HTML code with JS by using the user name in the return value of Ajax.
There is you in Ajax where the user name stored in the session, you do not refresh of course not to get its value.
After the background login verification is successful, the user name of the logged-in user is saved to the session, and a copy of the Ajax return value is saved.
Did you not innerhtml the new value to the user name location?
Describe the concrete point of the landlord.
Put your code up to see, this problem is not necessarily your refresh to get the value, because the login after the success is can be taken back to the background feedback session value, so is your code problem, you say so, we do not know where to start, Fixing a bug is definitely a matter of looking at the code and the feedback of the bug information before you know where the specific problem is.
Thank you for your support, I have solved the problem, thank you!!