如何在邮递员中删除会话cookie?

编程入门 行业动态 更新时间:2024-10-27 20:29:16
本文介绍了如何在邮递员中删除会话cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在Postman中测试我的API,无法模拟登出。

I am testing my API in Postman and am having trouble simulating a log out.

如果我打电话删除会话cookie, 会话cookie仍在 之后,我仍然可以访问需要身份验证的路由。

If I do a call to delete the session cookie, the session cookie is still there afterwards, and I'm still able to access routes that require authentication.

服务器上的路由处理程序为:

The route handler on the server is:

server.route({ method: 'DELETE', path: '/sessions/_current', handler: function(req, reply){ req.auth.session.clear(); reply({}).code(204); } });

这是带有Hapi的Node.js,但这没关系。

是否可以通过删除邮递员中的所有cookie 或手动某些cookie ?

推荐答案

在chrome浏览器中手动删除它会从Postman中删除cookie。

Manually deleting it in the chrome browser removes the cookie from Postman.

在您的chrome浏览器转到 chrome:// settings / cookies

In your chrome browser go to chrome://settings/cookies

查找并删除Cookie

Find the cookie and delete it

编辑: 根据下面的Max890注释(在我的Google Chrome浏览器(版本63)中),现在是 chrome:// settings / content / cookies 然后转到查看所有cookie和站点数据

As per Max890 comment below (in my version of Google Chrome (ver 63)) this is now chrome://settings/content/cookies Then go to "See all cookies and site data"

针对Google Chrome 79.0.3945.88的更新

chrome:// settings / siteData?search = cookies

chrome://settings/siteData?search=cookies

更多推荐

如何在邮递员中删除会话cookie?

本文发布于:2023-10-29 04:20:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538708.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮递员   如何在   cookie

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!