- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Purge expired RemoteControl API sessions?
10 months 3 weeks ago #227788
by H1441H
Purge expired RemoteControl API sessions? was created by H1441H
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 5.3.11+220425
Own server or LimeSurvey hosting: own server
Survey theme/template: default
==================
Sessions started with the RemoteControl API get stored in the sessions-table in the database, with there expiration date.
To save on server roundtrips, we do not start en stop a session with every request, as the sessionkeys is valid for 2h.
The consequence is that the sessions table is littered with expired session keys.
Is there any way to purge expired sessions? Or does this happen automatically somehow (when?)? I'm not comfortable with thousands of expired api keys in the database.
I can hardcode a query to the database to do it myself, but I rather not if this feature is already provisioned.
Thanks.
Your LimeSurvey version: LimeSurvey Community Edition Version 5.3.11+220425
Own server or LimeSurvey hosting: own server
Survey theme/template: default
==================
Sessions started with the RemoteControl API get stored in the sessions-table in the database, with there expiration date.
To save on server roundtrips, we do not start en stop a session with every request, as the sessionkeys is valid for 2h.
The consequence is that the sessions table is littered with expired session keys.
Is there any way to purge expired sessions? Or does this happen automatically somehow (when?)? I'm not comfortable with thousands of expired api keys in the database.
I can hardcode a query to the database to do it myself, but I rather not if this feature is already provisioned.
Thanks.
Please Log in to join the conversation.
10 months 3 weeks ago #227794
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Purge expired RemoteControl API sessions?
There is no built-in feature for this.
Despite the slightly increased server load, I recommend using the release_session_key() method to clear the session when done.
Despite the slightly increased server load, I recommend using the release_session_key() method to clear the session when done.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
10 months 3 weeks ago #227796
by H1441H
Replied by H1441H on topic Purge expired RemoteControl API sessions?
If i need to use release_session_key() on every call, I also need to get_session_key() for every (batch of) call(s). These extra roundtrips to the server and back do add up for the end user, it makes the application slower.
I cache the session key in memory and release the key via the api when it is (almost) expired. But when the server restarts or something errors out, the cache may be lost but the expired key persists in the database. I wanted to avoid this, but I will figure out something else.
Thanks
I cache the session key in memory and release the key via the api when it is (almost) expired. But when the server restarts or something errors out, the cache may be lost but the expired key persists in the database. I wanted to avoid this, but I will figure out something else.
Thanks
Please Log in to join the conversation.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 12881
- Thank you received: 2370
10 months 1 week ago #228268
by DenisChenu
Seems to be an issue (low)
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Purge expired RemoteControl API sessions?
No auto release after X hours ?There is no built-in feature for this.
Seems to be an issue (low)
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: H1441H
Please Log in to join the conversation.