Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser - Retrieve webviews current cookies Options
jkelly
Posted: Wednesday, May 6, 2015 9:48:16 AM
Rank: Advanced Member
Groups: Member

Joined: 2/26/2015
Posts: 53
Can you tell me/give me an example of how to retrieve the webviews current cookies?
I see that there is a CookiesCollection, but am not sure how to use it with my current webview session.

Thanks,
eo_support
Posted: Wednesday, May 6, 2015 11:14:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
Hi,

EO.WebBrowser does not provide any direct way to get cookies. The easiest way to get the current document cookies is use JavaScript document.cookies. The code would be like this:

Code: C#
webView1.EvalScript("document.cookies");


This will return a string that contains all cookies for the current document.

Thanks!
jkelly
Posted: Wednesday, May 6, 2015 12:05:10 PM
Rank: Advanced Member
Groups: Member

Joined: 2/26/2015
Posts: 53
Thanks got it.

Just to clarify, its "document.cookie"
I tried it with document.cookies and was getting null

Thanks.
eo_support
Posted: Wednesday, May 6, 2015 12:31:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
Hi,

Thanks for the correction.

You can try to run the same code in Chrome browser and see if you get null. If you get the correct value in Chrome browser but not in EO.WebBrowser, then please try to isolate the problem into a test project and send the test project to us. Once we have that we will investigate further. See here for more information on submitting test project:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.