localStorage not storing between sessions

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.

localStorage not storing between sessions

Postby wbea » Fri Sep 17, 2010 10:36 am

When I run this code from Chrome browser it works properly. It means, when I close the browser and load this page again localStorage.pageLoadCount have recently saved value. When the same code runs under cefclient.exe it works only during single session. After application restart pageLoadCount have initial value. Looks like cefclient.exe doesn't store localStorage data permanently.

Is it possible to make cefclient to store web storage databases somewhere on disk?

Code: Select all
[html]
[p]
  You have viewed this page
  [span id="count"]an untold number of[/span]
  time(s).
[/p]
[script]
  if (!localStorage.pageLoadCount)
    localStorage.pageLoadCount = 0;
  localStorage.pageLoadCount += 1;
  document.getElementById('count').textContent = localStorage.pageLoadCount;
[/script]
[/html]


(code taken from http://dev.w3.org/html5/webstorage/#introduction)

Please forgive me my poor English.

Alek
wbea
Newbie
 
Posts: 2
Joined: Fri Sep 17, 2010 5:28 am

Re: localStorage not storing between sessions

Postby magreenblatt » Fri Sep 17, 2010 2:48 pm

Are you using a disk-based cache? Pass a non-empty value as the |cache_path| argument to CefInitialize.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: localStorage not storing between sessions

Postby wbea » Fri Sep 17, 2010 3:37 pm

Yes, I'm using a disk-based cache. Cache folder contains some files (data_0 to 3, and index), but localStorage values are not stored.

I did simple test using this page http://demos.w3avenue.com/html5-unleashed-tips-tricks-and-techniques/sample-10-localstorage-demo.html.
I've tried other code too, but no matter whether disk-based cache is used, or not, values are not saved.
wbea
Newbie
 
Posts: 2
Joined: Fri Sep 17, 2010 5:28 am

Re: localStorage not storing between sessions

Postby magreenblatt » Sun Sep 19, 2010 11:04 am

Having local storage data persist if a cache_path is specified seems reasonable. Please add an issue to the CEF issue tracker.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: localStorage not storing between sessions

Postby Bauglir » Fri Oct 29, 2010 9:29 pm

Hi,
has there been any progress? Was that issue inserted into tracker? Can't find it...
Bauglir
Newbie
 
Posts: 8
Joined: Wed Sep 01, 2010 1:14 pm

Re: localStorage not storing between sessions

Postby Bauglir » Fri Oct 29, 2010 10:02 pm

Hi,
there seem to be the same problem with WebDatabase, WebDB API works, but after restarting application, database does not exists...
Bauglir
Newbie
 
Posts: 8
Joined: Wed Sep 01, 2010 1:14 pm

Re: localStorage not storing between sessions

Postby magreenblatt » Mon Nov 01, 2010 9:01 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

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