How to get HttpOnly cookies from awesomium?

一笑奈何 提交于 2019-12-13 07:35:05

问题


I want to get ALL cookies from the site, but most of them are HttpOnly.

JS does not work:

var cookie = webControl.ExecuteJavascriptWithResult("document.cookie;");

How to get HttpOnly cookies?


回答1:


why you're trying to get Cookies back from Javascript? ... the best opinion to get all Headers (including Cookies) is to use Awesomium with a Proxy written also in C# ...

Wiki: ProxyConfig http://docs.awesomium.net/html/P_Awesomium_Core_WebPreferences_ProxyConfig.htm

Github C# Proxy: https://github.com/justcoding121/Titanium-Web-Proxy

Titanium has 2 useful Events:

proxyServer.BeforeRequest += OnRequest;
proxyServer.BeforeResponse += OnResponse;

a Simple implementation which gave you the SystemEventArgs is:

public async Task OnRequest(object sender, SessionEventArgs e)
public async Task OnResponse(object sender, SessionEventArgs e)

After implementation you have the possibilty to grap all Headers and delete or modifiy it :)

Hope it helps ...



来源:https://stackoverflow.com/questions/43287040/how-to-get-httponly-cookies-from-awesomium

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!