Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Purge expired RemoteControl API sessions?

  • H1441H
  • H1441H's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #227788 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.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227794 by tpartner
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.

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.

  • H1441H
  • H1441H's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months 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

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #228268 by DenisChenu
Replied by DenisChenu on topic Purge expired RemoteControl API sessions?

There is no built-in feature for this.
 
No auto release after X hours ?

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.

Lime-years ahead

Online-surveys for every purse and purpose