Ubuntu – Google chrome logs out from every webpage after system user has logged out

cookiesgoogle-chromelogoutUbuntuubuntu 16.04

So I've got a really annoying problem and Google Chrome isn't providing me any information on what's causing it.

Every time I log into my account I have to again, and again, and again log into every webpage I'm using, because Google Chrome logs me out of everything I am logged in to. However, some cookies do persist, as Google remembers which account I have logged in to, and I still have access to my company's gitlab as well – it's the only service I'm not logged out of.

In case this is relevant, after I open Google Chrome there's an alert box next to my Google Chrome profile which says that Change made on my account requires logging in again (yes, it also logs me out from Google Chrome profile).

The problem does not appear when I do not log out from my system account (e.g. when I only close Chrome and open it again).

It does not happen on other browsers, only on Google Chrome.

Thanks in advance to everyone!


Update 1: Some specs/data:

OS: Ubuntu 16.04
Chrome: 53.0.2785.143 (64-bit)
Addons: Reddit Enhancement Suite, Adblock Plus, Ghostery, ColorZilla, Json View
Startup programs: Screencloud + ubuntu default ones

It did log me out even if I wasn't logged into any profile (so there weren't any addons installed as well, so I doubt it's an addon fault)

I also uninstalled Chrome and deleted .cache/google-chrome and .config/google-chrome directories entirely.


Update 2:

I ran Chrome from the terminal using google-chrome --enable-logging -v=1

Following errors did appear in terminal on browser startup:

[13645:13712:1007/142537:ERROR:gcm_store_impl.cc(306)] Failed to open database /home/user/.config/google-chrome/Profile 4/GCM Store: Invalid argument: /home/user/.config/google-chrome/Profile 4/GCM Store: does not exist (create_if_missing is false)
[13645:13712:1007/142537:ERROR:gcm_store_impl.cc(306)] Failed to open database /home/user/.config/google-chrome/Profile 4/GCM Store: Invalid argument: /home/user/.config/google-chrome/Profile 4/GCM Store: does not exist (create_if_missing is false)

However, the folder /home/user/.config/google-chrome/Profile 4/GCM Store does exist.

This error does not appear when starting chrome as root with:

sudo google-chrome --user-data-dir=/root/chrome-data --enable-logging -v=1

Update 3
So I closed Chrome, deleted /home/user/.config/google-chrome/Profile 4 directory and once again configured my account. I logged out, and then the following errors appeared:

[21285:21353:1007/145425:ERROR:gcm_store_impl.cc(922)] Failed to restore security token.
[21285:21285:1007/145425:ERROR:account_tracker.cc(357)] OnGetTokenFailure:  Not authorized.

Update 4:

I managed to fix (or at least I think so) the problems with Google Chrome errors and it does not log me out from Chrome Profile. I did this by moving the whole /root/chrome-data (created earlier) directory to ~/.config/google-chrome and changing it's owner. However, the browser still does not keep cookies after user logout.

Best Answer

I too would ask you to start over, by uninstalling and killing all chromium processes.

An operational note, you really shouldn't be logging in as the system account. You log in as yourself, and if you need to do system things, become root temporarily.

Also, logging out will kill any processes started by you which haven't been placed in the background.

For install:

sudo /bin/bash
exec su - root
pgrep -l chromium    # ensure list is empty, otherwise kill those processes
                     # pkill chromium
apt install chromium-browser
exit
id   # confirm you are now yourself and not root
# start chrome with specific directory
chromium-browser --user-data=~/.config/chromium >/dev/null 2>&1 &
# you could make this an alias in your .bashrc:
# alias chrome='chromium-browser --user-data=~/.config/chromium >/dev/null 2>&1 &'

You could add nohup to keep it running after logout, but re-attaching to it after logging in is problematic.

Once chrome is started, edit settings:

Choose Continue where you left off
Choose Offer to save your web passwords (in advanced settings)
Related Question