search

Home  >  Q&A  >  body text

javascript - Frontend login issue

The company's development model is front-end cutting and PHP pages. I have been cutting pictures for several months. After work, I have been recharging myself intermittently (after all, I became a monk halfway). I also came into contact with the separation of front-end and back-end. , vue.js and other things. At this time, I thought of a problem. After the current backend is separated and the user logs in, the backend must give the frontend a specific key value (let’s call it that for the time being, because I don’t have a specific concept) To determine a specific user, so as to provide different interfaces for different users. So where should the front-end store the key value reasonably?

If you are in a good mood, you can answer it in detail. If you are too lazy to explain, you can give me a few keywords and I will try to search them myself. Thank you

世界只因有你世界只因有你2788 days ago621

reply all(5)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-19 10:40:00

    Each user will have his or her own token, and save the token in cookie. Some basic information of the user will be stored in sessionStorage or localStorage. If the verification is passed, token verification will be fine

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-19 10:40:00

    cookie

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-19 10:40:00

    1. After the backend verifies the frontend login successfully, an encrypted token is returned

    2. The front-end stores the token in cookie or localstorage, and brings the token with each request. If the back-end verification passes, the data will be returned. If the verification fails, the corresponding status will be returned

    reply
    0
  • PHP中文网

    PHP中文网2017-05-19 10:40:00

    jwt verification mechanism

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-19 10:40:00

    json+web+token verification method

    reply
    0
  • Cancelreply