通过Nginx管理Web浏览器客户端Cookie

时间:2019-05-12 18:31:32

标签: nginx cookies

我是nginx的新手,想知道是否可以更改客户端Web浏览器的cookie?

我想基本上为客户端发送到后端的每个请求生成一个JWT令牌。然后,我想将JWT令牌添加到Web浏览器客户端的cookie。因此,对于每个请求,JWT令牌都位于cookie中,并且每次都会生成并保存一个新的令牌。

server {
    listen       80;
    server_name  localhost;

    location / {
        root   html;
        index  index.html index.htm;
        add_header Set-Cookie jwt='test';
    }
}

我已经在本地运行了基本设置,但是当我浏览开发者控制台网络和应用程序cookie时,似乎在任何地方都看不到该cookie。甚至有可能这样做吗?

0 个答案:

没有答案