【问题标题】:How to check if website uses cookies or not using Curl command?如何检查网站是否使用 cookie 或不使用 Curl 命令?
【发布时间】:2019-04-23 05:34:32
【问题描述】:

我想知道服务器是否使用 cookie 或不使用 Curl 命令。 我用这个命令curl -k -c - "domain name" 但我得到了回应

Access denied# Netscape HTTP Cookie File https://curl.haxx.se/docs/http-cookies.html This file was generated by libcurl! Edit at your own risk.

如何验证?

【问题讨论】:

    标签: curl cookies


    【解决方案1】:

    通过使用grep 在标头中搜索 cookie 并使用 wc 提供 TL;DR,

    curl 'https://stackoverflow.com/questions/55804909/how-to-check-if-website-uses-cookies-or-not-using-curl-command' -o /dev/null --dump-header - 2>&1 | grep -i "set-cookie" | wc -l
    

    如果页面正在使用 cookie,则打印 >=1,否则(几乎可以肯定)打印 0。它通过查找用于设置 cookie 的 Set-Cookie HTTP 标头来工作。

    【讨论】:

      猜你喜欢
      • 2016-08-25
      • 2017-10-03
      • 2018-01-03
      • 2016-05-25
      • 2013-07-30
      • 2017-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多