# Kibana SESSION\_EXPIRED

**URL:** <https://discuss.elastic.co/t/kibana-session-expired/289506>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [November 17, 2021, 9:09pm UTC](https://discuss.elastic.co/t/kibana-session-expired/289506 "2021-11-17T21:09:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mst3r25](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mst3r25/32/97109_2.png) [@mst3r25](https://discuss.elastic.co/u/mst3r25)\
**Post date:** [November 17, 2021, 9:09pm UTC](https://discuss.elastic.co/t/kibana-session-expired/289506/1 "2021-11-17T21:09:37Z")

</div>

I keep getting random SESSION\_EXPIRED when after implementing PKI authentication. If I use username and password my session never expires. Sometime I am able to use PKI to log back in after the SESSION\_EXPIRED, other times I have to close the browser or clear the cookies before I can log back in with PKI.

Elasticsearch 7.14  
Kibana 7.14  
Elasticsearch config  
\</\>  
xpack:  
security:  
authc:  
token.enabled: true  
realms:  
pki:  
pki1:  
order: 1  
delegation.enabled: true  
truststore:  
path: "my\_truststore.p12"  
\</\>  
Kibana config  
\</\>  
server.ssl.clientAuthentication: optional  
xpack.security.authc.providers:  
pki.pki1:  
order: 0  
basic.basic1:  
order: 1  
xpack.security.session.idleTimeout: "5h"  
xpack.security.session.lifespan: "24h"

# I've also tried this below.

#xpack.security.authc.providers.pki.pki1.session.idleTimeout: "5h"  
xpack.security.encryptionKey: "Something longer than 32 characters. I do have white spaces"  
\</\>

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 2, 2021, 8:06pm UTC](https://discuss.elastic.co/t/kibana-session-expired/289506/2 "2021-12-02T20:06:06Z")

</div>

I'm not completely sure, but the problem could be related to this issue: [Handle access tokens that expire after authentication stage · Issue #104893 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/104893)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 30, 2021, 8:06pm UTC](https://discuss.elastic.co/t/kibana-session-expired/289506/3 "2021-12-30T20:06:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
