Welcome Guest Search | Active Topics | Sign In | Register

Deleting Cookie or Clear Cookies Options
Tim
Posted: Thursday, February 1, 2018 6:50:16 AM
Rank: Newbie
Groups: Member

Joined: 1/10/2018
Posts: 8
I have tried removing cookies via the Request in methods like BeforeSendHeaders, but they still seem to be used in requests. Is there anyway to delete the cookies either all or individually.
eo_support
Posted: Thursday, February 1, 2018 8:39:55 AM
Rank: Administration
Groups: Administration

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

Please use BeforeRequestLoad event instead. You can not modify the request in BeforeSendHeaders event handler, but you can do so in BeforeRequestLoad event handler.

Thanks!
Tim
Posted: Thursday, February 1, 2018 8:57:22 AM
Rank: Newbie
Groups: Member

Joined: 1/10/2018
Posts: 8
Only trouble is that BeforeRequestLoad doesn't have any cookies in the collection for some reason, it is count = 0, but beforesendheaders does
eo_support
Posted: Thursday, February 1, 2018 9:01:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Ah --- you are correct. In that case you won't be able to use it for your purpose. BeforeRequestLoad is triggered before the cookies in the cookie jar has been loaded. The only other way you can try is to use a custom resource handler:

https://www.essentialobjects.com/doc/webbrowser/advanced/resource_handler.aspx

This way you will be taking over the resource loading layer completely. You will want to only intercept the requests you wish to modify though since the browser engine's resource loader is highly optimized and if you take over it completely for all resources it could have a significant negative impact on the performance.
Tim
Posted: Thursday, February 1, 2018 10:53:52 AM
Rank: Newbie
Groups: Member

Joined: 1/10/2018
Posts: 8
Ok, so see how that will work, but is there any way I can add the base ProcessRequest, as I need to know what it normally does for normal requests.
eo_support
Posted: Thursday, February 1, 2018 1:48:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
No. You can not modify it and pass it down streams. You either take over completely or do not touch it at all.
BenjaminSimpson1989
Posted: Thursday, February 1, 2018 7:01:41 PM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
Is there any way to remove the cookies using Javascript?
eo_support
Posted: Thursday, February 1, 2018 9:18:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
No. Not the one you are sending to the server.
BenjaminSimpson1989
Posted: Thursday, February 15, 2018 11:42:52 AM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
I was able to clear the cookies by executing the Javascript listed here: https://stackoverflow.com/a/33366171

However, I was wondering if I can do this type of cookie manipulation directly with .NET code.
eo_support
Posted: Thursday, February 15, 2018 12:33:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
BenjaminSimpson1989 wrote:
I was able to clear the cookies by executing the Javascript listed here: https://stackoverflow.com/a/33366171

However, I was wondering if I can do this type of cookie manipulation directly with .NET code.


Thanks for sharing. You can run any JavaScript code from .NET side with this function:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.evalscript_overloads.aspx
BenjaminSimpson1989
Posted: Thursday, February 15, 2018 3:32:03 PM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
I'm already using that function to execute the Javascript. I was just wondering if I could manipulate the cookies in the browser directly through .NET instead.
eo_support
Posted: Friday, February 16, 2018 3:52:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
BenjaminSimpson1989 wrote:
I'm already using that function to execute the Javascript. I was just wondering if I could manipulate the cookies in the browser directly through .NET instead.


No. We do not have direct support for this yet.
BenjaminSimpson1989
Posted: Monday, February 19, 2018 9:52:43 AM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
Is there any plan to in the near future?
eo_support
Posted: Monday, February 19, 2018 4:05:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
We are looking into this. Will reply here again once we have more information.
BenjaminSimpson1989
Posted: Monday, June 18, 2018 5:34:13 PM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
It looks like you added support with the Cookie Manager
eo_support
Posted: Monday, June 18, 2018 6:51:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Yes. We did add this feature recently. Sorry for not having updated this thread.


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.