Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cookie is not saved if system power is interrupted

On Raspberry Pi Raspbian Chromium Kiosk-Mode, I am saving a cookie:

document.cookie = "currentImage=" + currentImage + ";expires=2038-01-19, 03:14:08 UTC; path=/"

Then after a while the power to the Pi is cut. When the system is restored, the cookie cannot be read. Is there a way to persist the cookie in JS?

like image 656
Kashif Avatar asked Jun 27 '17 12:06

Kashif


1 Answers

It seems that you have misconfigured profile (Your profile that saves all data inside including the cookies). Check this blog post for bare config.

Also, make sure there is a directory with this path ~/.config/chromium (This is the default directory for your profile data). And, you can also this option to set user data dir explicitly

chromium-browser --user-data-dir=DIR

--user-data-dir=DIR

Specifies the directory that user data (your "profile") is kept in. Defaults to ~/.config/chromium . Separate instances of Chromium must use separate user data directories; repeated invocations of chromium-browser will reuse an existing process for a given user data directory.

Personally, I didn't face this problem before but I tried to give you some insights and keys to the solution. Therefore, I highly recommend if you still face the problem to check this list for chromium different options

like image 67
Mouneer Avatar answered Oct 02 '22 08:10

Mouneer