0
如何在猫鼬网络服务器上用C++设置cookie? 我在这里找到了一些东西https://www.cesanta.com/developer/mongoose#_mg_http_parse_header但我不确定我是不是在看什么。如何在猫鼬服务器上设置cookie?
如何在猫鼬网络服务器上用C++设置cookie? 我在这里找到了一些东西https://www.cesanta.com/developer/mongoose#_mg_http_parse_header但我不确定我是不是在看什么。如何在猫鼬服务器上设置cookie?
您应该发送一个Set-Cookie
HTTP标头给客户端。那里使用mg_send_head()
,https://www.cesanta.com/developer/mongoose#_mg_send_head这样做与猫鼬,例如多种方式:
mg_send_head(conn, 200, content_len, "Set-Cookie: token=1234; Expires=Wed, 09 Jun 2021 10:18:14 GMT");
的Set-Cookie报头格式中http://tools.ietf.org/html/rfc6265进行说明。维基百科也有很好的文章,https://en.wikipedia.org/wiki/HTTP_cookie