In Play framework there is an API to create a session, put some data to the session and discard the session. But I would also like to have some insight into things like how many active sessions are currently in my installation, how many data in volume is bound to them, etc. Are there any means to deal with this?
Play is by stateless by nature, thus no session exists on the server to be tracked or monitored. When you use session API you just create a cookie that will be sent with every request / response from/to the browser.
This cookie doesn't have a timeout or expiration date, hence it will persist as long as the browser is open. However you can implement your own session timeout mechanism by setting a last access time on the session cookie and compare it to the desired timeout on every request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With