User session logout

Hello Team,

We are running Grafana v7.1.5 on RHEL 8.1 server.

Lately, we are facing issue that any user who logged into Grafana gets automatically logged out after an hour or two. After reading the documents, we have updated following configuration under /etc/grafana/grafana.ini file. However, updating these configuration did not help.

Any help or suggestion to keep user login session for permanently or atleast 24 hours will be appreciated.

[auth]
# Login cookie name
login_cookie_name = grafana_session

# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days,
login_maximum_inactive_lifetime_days = 365

# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days.
login_maximum_lifetime_days = 30

# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 525600

Thank you.
Ravi.

Hello Everyone,

Any suggestions on this issue?

Hi,

Are you using a proxy or VPN to connect to Grafana ?

Note : I suppose you restarted Grafana after changing the ini file.

Good Luck

Thanks for the response.

We are not accessing Grafana through VPN or a proxy. It’s in a local network so we don’t need any proxy or VPN to access it.

Yes. I did restart Grafana services after updating grafana.ini file.

Hi,

Please try to empty those fields and test :

login_cookie_name = grafana_session

login_maximum_inactive_lifetime_duration =

login_maximum_lifetime_duration =

token_rotation_interval_minutes = 10

Source : Overview | Grafana Labs

Regarding the version you are using, i passed by a change that was made for those fields may be relevant. Check this thread :

Good Luck

I think this is a ‘me too’.

New user here. Running Firefox 84.0 under Ubuntu 20.04. When I log into my grafana instance, after a period of time of me leaving it alone, a pop-up displays

“This page is asking you to confirm that you want to leave - data you have entered may not be saved.”
Stay on Page Leave Page

If I press ‘Stay on Page’, it just repeats the pop-up 4 more times, then displays a red “Unauthorized” message. If I press ‘Leave Page’, it returns me to the login page.

I can’t tell you how many minutes elapses before this message because I leave my desk for random periods of time.

I appreciate that this pop-up happens because I have unsaved changes on the screen. That’s because I’m doing my learning and modifying over several days. I know that I can save the changes to prevent this pop-up, but all that achieves is that it returns to the login screen without prompting. I don’t want it logging me off. Ever. Or, at least, for many, many hours of my choosing.

I run this at home privately. There is no external access and I’m the only one using the machine. Preferably I’d like to disable logins. Failing that, I’d like to remove the timeout altogether. Failing that, I’d like to know how to extend the timeout for a period of my choosing.

My grafana.ini file’s [auth] section is still the default, namely:

[auth]
;login_cookie_name = grafana_session
;login_maximum_inactive_lifetime_duration =
;login_maximum_lifetime_duration =
;token_rotation_interval_minutes = 10
;disable_login_form = false
;disable_signout_menu = false
;signout_redirect_url =
;oauth_auto_login = false
;oauth_state_cookie_max_age = 600
;api_key_max_seconds_to_live = -1
;sigv4_auth_enabled = false

I have stopped/restarted the service many times without improvement.

Hi,

Please refer to :

Hope it helps.