获取(Set-Cookie)的值并将其存储在8号浏览器中

问题描述 投票:1回答:1

我是一名新的Web开发人员,使用Spring Boot和angular 8。当我尝试使用用户名和密码登录时,服务器会生成令牌并将其发送回http响应,因此我的问题是如何获取cookie的值并将其存储在浏览器中。this is the java code that store the cookie in the header.

this is the response header where the token is.

spring-boot angular8 setcookie web-development-server
1个回答
0
投票

设置cookie需要在服务器端进行处理,由于您在HTTP请求中看到了Set-Cookie标头,因此一切似乎都很好。 (您也可以通过导航到Chrome开发工具中的Application标签,然后在左侧面板上选择Cookies进行检查)

© www.soinside.com 2019 - 2024. All rights reserved.