How to SetCookie?SetCookie not working in v109.0.5414.87

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: How to SetCookie?SetCookie not working in v109.0.5414.87

Postby YogeshTembe » Mon Jun 19, 2023 3:16 pm

Thank you so much for providing me with your code I really appreciate the efforts.The way I have been setting the cookie is also similar yet the cookie does not seem to be set.How do you validate if your cookie has been set and sent with the request to browser.There could be an issue with the url and domain hence the cookie is not being set.If you have a sample cookie value for a sample website for which the cookie is set 100% I would like to give that a try as well so if anyone could share that with me it would be great!
YogeshTembe
Techie
 
Posts: 23
Joined: Tue Sep 14, 2021 6:01 am

Re: How to SetCookie?SetCookie not working in v109.0.5414.87

Postby ndesktop » Tue Jun 20, 2023 2:51 am

I cannot provide the cookie or the value (security reasons). But they are related to a login page for a chrome extension.
Maybe the SetCookie returns false in your case? I think of URL not matching the domain (or the prefixed .domain) or something else.
For verification I am looking to the Cookies sqlite database from the CefSettings's cache path, using any tool for SQLite db query, and then do a "seelct * from Cookies".
The test is:
- run first time, navigate to the URL to save cookies for and do the actions (login, visit etc.) that creates the cookies
- when the CEF app ends, save the cookies into some file and clear the cache path
- run second time and load the cookies from the previous file and do the SetCookie logic
- check the Cookies db file (might fail due to sharing violation)
- close the CEF app without clearing the Cookies file.
Result is that the second Cookies file contains the cookies set up via load from file + SetCookie from the second instance initialization.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: How to SetCookie?SetCookie not working in v109.0.5414.87

Postby YogeshTembe » Thu Jun 22, 2023 6:09 am

Thank you so much for your Kind reply.I still am unable to resolve the issue.I had a doubt so I'm tryin to ensure that once I close the browser and then again open a new browser I'm trying to set all the cookies I saved from the previous session now in my case everytime before the browser is started the cache folder is deleted and hence I was hoping that when I set the cookie again in OnBeforeBrowse it will let me continue the same session that I was on previously but this seems to fail does cef not allow this because in my understanding only calling setcookie should have been enough but that does not seem to be the case.
YogeshTembe
Techie
 
Posts: 23
Joined: Tue Sep 14, 2021 6:01 am

Previous

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 200 guests