BenWoodford / SteamVR-Webkit

Toolkit for building WebKit-based overlays for SteamVR.
MIT License
23 stars 10 forks source link

Cookies are not saved between sessions. #2

Closed SteffanDonal closed 7 years ago

SteffanDonal commented 7 years ago

I tried to naively get this working by specifying CefSettings with a CachePath set, but this doesn't work.

Any help?

BenWoodford commented 7 years ago

Try this

SteamVR_WebKit.SteamVR_WebKit.Init(new CefSharp.CefSettings() { PersistSessionCookies = true, CachePath = "whateveryouwant" });
SteffanDonal commented 7 years ago

That's what I tried, but I couldn't get it saving. Wasn't sure if it was because the only way to quit was to CTRL+C or kill the project in Visual Studio, so I tried adding a clean exit calling Cef.Shutdown();, but this didn't work either.

I did have write permissions to the folder, as a ~128KiB file for visited sites was created.

BenWoodford commented 7 years ago

Huh, that should work, everywhere else says it does. Very odd.

Shall have to do some reading.

amaitland commented 7 years ago

Your RequestContextSettings likely has an empty CachePath.

http://cefsharp.github.io/api/55.0.0/html/P_CefSharp_RequestContextSettings_CachePath.htm

BenWoodford commented 7 years ago

Ah, so they both need the cachepath set then? CefSettings and RequestContextSettings

SteffanDonal commented 7 years ago

Excellent, that fixed the issue. Turns out it was already exposed as WebKitOverlay.CachePath, which must be set before running .StartBrowser();