search

Home  >  Q&A  >  body text

javascript - Single page cookie issue

angular2 application, use js to set the cookie when logging in, then exit and delete the cookie, confirm that the cookie no longer exists, enter the previous login link in the url, and the cookie appears again, why? How to solve it

过去多啦不再A梦过去多啦不再A梦2841 days ago555

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-05-19 10:13:39

    It has been changed. Angular’s ​​cookies need to use DI injection. If you change it to Service, it will be ok

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-19 10:13:39

    Did you write down the user ID, then adjust the interface every time you go to this page, and then write it in again?

    reply
    0
  • Cancelreply