Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cef 81 not save all cookie data #3120

Closed
bbday opened this issue May 6, 2020 · 14 comments
Closed

Cef 81 not save all cookie data #3120

bbday opened this issue May 6, 2020 · 14 comments
Labels
more-details-needed-from-op unable-to-reproduce The problem could not be reproduced by developers

Comments

@bbday
Copy link

bbday commented May 6, 2020

I used Cef WPF minimal example with current stable version v79 and work great, i update cef to beta version 81.3.10-CI3509 and not working.
I tested also cefclient v81 (with cache path parameter) and it work, then i think is issue with cefsharp client.

The issue is example loading this web address https://www.easports.com/fifa/ultimate-team/web-app/ on response it must setup 2 cookie on cache, in fact it will setup just one (dont know why look like not rember cookie with parameter Max-Age=7178) then when you reload app and load data from cache path dont rember all cookies.

@amaitland
Copy link
Member

Please fill out the Bug Report Template

then i think is issue with cefsharp client.

To be honest that's quite unlikely. Cookies are entirely managed by CEF/Chromium.

I tested also cefclient v81 (with cache path parameter) and it work,

What version did you test with? What command line args did you use?

@bbday
Copy link
Author

bbday commented May 6, 2020

Cef WPF minimal example, i didnt use any arg (cause by default is setup cache folder) just loaded app and used fiddler to look calls with stable cefsharp wpf v79 (last) it work without this issue, then i switchet to 81.3.10-CI3509 that have this issue.

About cefclient i used CEF 81.3.1+gb2b49f1+chromium-81.0.4044.113 x64 --proxy-server=myproxy:port --cache-path=myFolder and it work without issue only with cefsharp v81 i have this issue before i dont know why.

x64 Windows 10 WPF

@amaitland
Copy link
Member

Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)

Did you check the log file to see if any errors are listed?

If you are using WPF/OffScreen run
cefclient.exe --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu --disable-gpu-compositing --no-sandbox --disable-site-isolation-trials
MAKE SURE TO TEST WITH THE COMMAND LINE ARGS LISTED ABOVE

As per the Bug Report Template you need to use the command line args as listed in the template for an accurate comparison with CefSharp. Add the cache and proxy command line args as well of course.

@bbday
Copy link
Author

bbday commented May 7, 2020

  • On debug.log no info or error
  • I tried with your args and working like expect (it save all cookie then in next session rember them)

@amaitland
Copy link
Member

If you haven't already please try deleting the cache. Issue https://bitbucket.org/chromiumembedded/cef/issues/2890/all-the-cookies-are-deleted-automatically may require an empty cache to start from.

@shimengkeji
Copy link

If you haven't already please try deleting the cache. Issue https://bitbucket.org/chromiumembedded/cef/issues/2890/all-the-cookies-are-deleted-automatically may require an empty cache to start from.

I try it, But it doesn't work. Page didn't work as expected. 79.1.360 does not have this problem

@amaitland
Copy link
Member

It's unclear how to reproduce this problem. The https://www.easports.com/fifa/ultimate-team/web-app/ page is full of debugger; statements in it's JavaScript so is unusable for testing purposes. A vague paragraph containing a few lines about the problem is insufficient

What I require is:

  • A detailed set of clear instructions of how to reproduce the problem using DevTools for debugging
    • Dot point list is preferred
    • Details on expected result and the actual result in terms of cookies
  • A minimal example url that can easily be used to reproduce the problem using DevTools.
    • Ideally the url has minimal javascript and css to allow for easy analysis
  • The https://github.com/cefsharp/CefSharp.MinimalExample/tree/cefsharp/81 branch has been updated with the 81.3.20-pre release and should be used for testing.

If someone can provide sufficient details then I will have look.

@amaitland
Copy link
Member

@shimengkeji Have you confirmed that cookies are persisted using Chrome for the url you linked? Session cookies aren't persisted by default in any browser that I'm aware of.

Cookies set by JavaScript can be saved.

@amaitland
Copy link
Member

Let me give you an example of my decision to compare the next two cefsharp versions of cookies. Let's see which cookies have not been saved

@shimengkeji I have absolutely no idea what you mean by this. What does the next two cefsharp versions of cookies mean exactly?

@amaitland
Copy link
Member

I try 81.3.20-pre on https://www.w3school.com.cn/tiy/t.asp?f=js_cookie_username

This url has text in what i presume is Chinese. I only speak English. I have no idea what the dialog is asking for.

What I've asked for is a dot point list of steps used to reproduce the problem. Please provide clear and concise steps.

An example of the sort of detail that is required:

Using https://github.com/cefsharp/CefSharp.MinimalExample/tree/cefsharp/81 for testing.

  • Launch CefSharp.MinimalExample.WinForms (using x64 build)
  • Navigate to http://cefsharp.github.io/demo/cookiereadwrite.html
  • Click the Set link that appears on each row (4 links to be clicked).
  • Click Update and confirm the cookie data is displayed.
  • Open DevTools (File -> Show DevTools)
  • Select the Application tab.
  • On the left hand side select Storage -> Cookies
  • Expand the cookies option and select http://cefsharp.github.io
  • Confirm the four cookies are present.
  • Close DevTools
  • Exit the application (File -> Exit)
  • Launch CefSharp.MinimalExample.WinForms (using x64 build)
  • Navigate to http://cefsharp.github.io/demo/cookiereadwrite.html
  • Open DevTools (File -> Show DevTools)
  • Select the Application tab.
  • On the left hand side select Storage -> Cookies
  • Expand the cookies option and select http://cefsharp.github.io
  • Confirm the four cookies are present.

Cookies are persisted as expected. Subsequently launching CefSharp.MinimalExample.Wpf and navigating to http://cefsharp.github.io/demo/cookiereadwrite.html shows
the cookie output

Please make sure to use https://github.com/cefsharp/CefSharp.MinimalExample/tree/cefsharp/81 for testing so I have a baseline for comparison.

I don't know if it will help you

Unfortunately no it doesn't help me at all. Saying you have confirmed the output doesn't provide me with a means to reproduce the testing that you have done.

@amaitland
Copy link
Member

Can someone please load chrome://version in both cefclient and the CefSharp.MinimalExample and copy and paste the content here so I can compare the details, cachepath, commandline args etc.

Thanks.

@amaitland
Copy link
Member

@amaitland
Copy link
Member

If non-empty this must be either equal to or a child directory of CefSettings.RootCachePath.

@shimengkeji As per http://cefsharp.github.io/api/79.1.x/html/P_CefSharp_RequestContextSettings_CachePath.htm
This has been the documented behaviour for quite some time. It may have worked previously where cache paths were in different folders. You must comply with this requirement now. Cookies won't work otherwise.

@shimengkeji
Copy link

shimengkeji commented May 16, 2020

If non-empty this must be either equal to or a child directory of CefSettings.RootCachePath.

@shimengkeji As per http://cefsharp.github.io/api/79.1.x/html/P_CefSharp_RequestContextSettings_CachePath.htm
This has been the documented behaviour for quite some time. It may have worked previously where cache paths were in different folders. You must comply with this requirement now. Cookies won't work otherwise.

Thanks, My problem has been solved !

@amaitland amaitland added the unable-to-reproduce The problem could not be reproduced by developers label May 18, 2020
@bbday bbday closed this as completed May 19, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
more-details-needed-from-op unable-to-reproduce The problem could not be reproduced by developers
Projects
None yet
Development

No branches or pull requests

3 participants