cookie output from vue

Asked 2 years ago, Updated 2 years ago, 66 views

django and vue.The login function is being implemented by linking js. The login was successful, and if the login is successful, I want to check the login through the sessionid created by Jango. But I'm trying to get the sessionid from vue, but it says it's missing. How can I import it or should I implement login in another way? The cookie output was made using a library called vue-cookies. Code used for cookie output: console.log(this.$cookies.keys()); Cookies checked with developer tools The output result of the above code shows csrftoken, but not sessionid.

javascript django vue cookie

2022-09-21 15:57

1 Answers

It's natural that it doesn't come out and it doesn't have to. Can you see the 마크 mark on the right side of the first shot? It means cookies that correspond to the HTTP Only option.

Cookies with the HTTP Only option are only used to send HTTP requests to the server (which is why they are called "HTTP Only") and are not extracted or used by clients. That way, you can use it as an authentication key so that you can log in. So it's a good idea to try and get the cookie using a vue-cookie or other client means. Take a life coding course for more information.


2022-09-21 15:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.