Cookies Not Working?

1,167 views
Skip to first unread message

resentm...@gmail.com

unread,
Mar 16, 2013, 6:45:57 PM3/16/13
to cefs...@googlegroups.com

I'm trying excute Script to get Cookies in my favour page but no thing happens, i'm open devtool but it blank. please help me!


Alexander Stulov

unread,
Mar 17, 2013, 8:54:14 AM3/17/13
to cefs...@googlegroups.com
To enable persistent cookies database feature should be enabled (BrowserSettings.DatabasesDisabled =  false)

Alexander Stulov

unread,
Mar 17, 2013, 8:57:40 AM3/17/13
to cefs...@googlegroups.com
Then you can get cookies in js like: document.cookie (as in any other browser)

resentm...@gmail.com

unread,
Mar 17, 2013, 10:15:24 AM3/17/13
to cefs...@googlegroups.com
I've set this Setting, but it not working. this is my simple code:

            var set = new Settings();
            set.CachePath = Application.StartupPath + @"\Cache";
            CEF.Initialize(set);

            BrowserSettings bset = new BrowserSettings();
            bset.DatabasesDisabled = false;

            web = new WebView("http://IDVLCM.ZING.VN", bset);
            web.Dock = DockStyle.Fill;
            _toolStripContainer.ContentPanel.Controls.Add(web);
            web.CreateControl();

Alexander Stulov

unread,
Mar 19, 2013, 4:34:14 AM3/19/13
to cefs...@googlegroups.com

I have also faced such issue: in combination with localStorage persistent cookies are save “sometimes”. For example: add some value to localStorage, add persistent cookie. Reload application: cookie will be also loaded.

We didn’t find any explanation of such strange behavior.

Workaround: replace persistent cookies by localStorage usage (that is how we solved it for us).

anthony taranto

unread,
Mar 19, 2013, 2:34:09 PM3/19/13
to cefs...@googlegroups.com
CEF only flushes cookies to disk every 30 seconds, or immediately when CEF.Shutdown() is called. If you set a cookie then exit within 30 seconds without calling CEF.Shutdown(), the cookies will not be persisted.

--Anthony

--
You received this message because you are subscribed to the Google Groups "CefSharp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages