Javascript-ajax Session Refresh Problem

Source: Internet
Author: User
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!!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.