Why do mobile sessions last an hour but desktop don't expire.
I'm simply setting the cookie with:
// app.run
$http.defaults.headers.common['X-CSRF-Token'] = $cookies.get('csrftoken');
This works perfectly fine on desktop (many months) but with mobile it only lasts ~1 hour. Why does this happen? Do you need to set cookies differently on mobile (tested in both safari and chrome for iOS)? It's not because a user closes the tab because you can close and re-open and still have the session.
Finally, what is the solution to this problem to keep users logged in for say 30 days? LocalStorage?
ApplicationController
protect_from_forgery with: :exception
after_action :set_csrf_cookie_for_ng
def set_csrf_cookie_for_ng
cookies['csrftoken'] = form_authenticity_token if protect_against_forgery?
end