1

I am working with the Kong session plugin, currently I am able to successfully store client's session, however, I am trying to understand how this expiry works. In the session config I have cookie_lifetime: 60 and cookie_renew: 10. After I create the initial session I can see the session info via the admin api at http://localhost:8001/sessions with the following info:

{
  "data": [
  {
    "ttl": 57,
    "id": "56884572-3b77-4749-8116-0e09e8d5e62c",
    "created_at": 1624653628,
    "data": "lcCrlzrVJzN4p1kwdwWAEfAOjK0u5uCPWvAckVCg-3Wjwi4WWLsxuEOnP64wtO7yIvefRyHZHdyqNgqionuaDnr8NKXorJFDqAaLm6lazM",
    "expires": 1624653688,
    "session_id": "7sNBzxBoQuSUgx2N9GRn4w"
  }],
  "next": null
}

Since my session_renew is set at 10 seconds, I do see it create new sessions when ttl < 10, it keeps doing this over and over, however, after some period of idle time when I come back to check the session info the session gets deleted. So I guess I'm not understanding how the cookie_renew works since based on my understanding it should keep renewing the session when ttl < 10, so not sure what causes it to delete the session.

The goal is to be able to send the client (or client can pull for this information) before the session is about the expire, and allow the client to touch the session to restart the timer or logout.

tiger_groove
  • 956
  • 2
  • 17
  • 46
  • Why not create long life session, instead of asking the client to return ? – Ôrel Jun 27 '21 at 07:29
  • 1
    My session lifetime to the default of 3600 seconds (1 hour). I was using the above as an example to illustrate my findings. I guess my question is, how does the session renew work, when does session expire when we set the session renew value at 10 seconds? – tiger_groove Jun 27 '21 at 20:54

0 Answers0