Opensearch dashboards throwing internal several error after 2 hours in login

I have deployed Opensearch 2.1 on kubernets. I am logging in with a user and monitoring a single dashboard which are set on auto refresh on a particular interval.
After 2-3 hours it is throwing Internal server error 500 and thus not able to access the dashboards again.
i have created a tenant say demo and the user has only access to that tenant only.
On checking kubernets log it is showing “Tenant global is not allowed for this user”.
This error is temporarily gone after flushing the cache “DELETE _plugins/_security/api/cache”. But again after some hours it is occuring again.
We have setup only basic auth.

“basic_internal_auth_domain” : {
“http_enabled” : true,
“transport_enabled” : true,
“order” : 4,
“http_authenticator” : {
“challenge” : true,
“type” : “basic”,
“config” : { }
“authentication_backend” : {
“type” : “intern”,
“config” : { }
“description” : “Authenticate via HTTP Basic against internal users database”

I am not able to understand what is causing this error.
Please request any more info you need from my side.

@harshitS I understand that you have a user that is constantly logged in to OpenSearch Dashboards for hours, am I correct?

Yes, you are correct . That is the main purpose of the project.

@harshitS Try the below settings in the opensearch_dashboards.yml.

opensearch_security.cookie.ttl: 86400000
opensearch_security.session.ttl: 86400000
opensearch_security.session.keepalive: true