Can't keep user logged in

Jacob3 years ago

Just updated from 3.something to 5.3. With the old interface I had the option to stay logged in, and it would stay logged in for a few weeks before asking for my password again. The new interface doesn't have that option on the login screen, and the default session timeout is much shorter, possibly just a few hours. Every time I visit my server's web interface or load the manager app after a few hours, it requires me to insert my password again.

Is there a trick to staying logged in on 5.3 or is that just not supported yet in the new interface?

Anton Tananaev3 years ago

It would only require to re-login this frequently if you restart the server. You can try persisted sessions if you really need to restart server regularly.

Jacob3 years ago

How do I turn on persisted sessions? I can't find anything in the config file documentation for that. Last night I logged in and this morning it asked for my password again, and I know I didn't restart the server overnight.

Anton Tananaev3 years ago
Jacob3 years ago

Oh sweet. Just added that into my config file and sessions do persist across restarts now. Will report back if I open the app or the site after a few hours and it asks for my password again.

Jacob3 years ago

Unfortunately it still times out too fast. I just opened the manager app and was greeted with the login screen.

Anton Tananaev3 years ago

Android or iOS? What version of the OS and the app and other details?

Jacob3 years ago

Traccar Manager 3.1 on iOS 15.6.1. Server is running the 5.3 docker image. I also just uninstalled and reinstalled the app to see if that would fix it.

Anton Tananaev3 years ago

For iOS we will have touch id / face id support starting from next release.

Jacob3 years ago

Would I still be able to stay logged in if I choose not to use face/touch ID?

Anton Tananaev3 years ago

Technically it should already work. I'm not sure why it doesn't work for you.

Jacob3 years ago

Is there anything I should look in the database for? I did upgrade from v3, so there might be something left over that’s forcing sessions to expire, but I don’t even know where to start with that. I don’t want to wipe it because I’d lose the last year of history

Jacob3 years ago

Just tried uninstalling and reinstalling the manager app again and it did not stay logged in. My iOS shortcut to start my car worked (uses basic auth) but the notification that my car had started did not come through because the app had been logged out.

I might just wipe the database and import just the history and see if that’ll work

Jacob3 years ago

After more experimentation, it's looking like the main issue is traccar doesn't add Max-Age to the JSESSIONID cookie, so it defaults to session and the browser/app wipes it whenever it thinks the "session" is over. If traccar added Max-Age to the cookie and periodically reset the cookie with a new Max-Age that would fix it.

Until then, what's working for me is switching to a docker build of nginx with lua support (already using nginx for https reverse proxy) and using that to add Max-Age to the cookie. Set it up last night and I didn't have to login this morning, and remote start notifications are still coming through.

Anton Tananaev3 years ago

Why does the session change? Are you killing the app?