Support » Plugin: Fast Secure Contact Form » wp_sessions are not auto removed

  • Resolved Qcybb


    This plugin is creating wp_sessions in the options table and they are not being auto removed. I’ve read in another support thread that they were supposed to be auto deleted after 30 mins – which is not happening.

    I’ve just opened up a new blog which receives 20 visitors a day and already have 600 “wp-session” entries and it’s climbing up every day.

    How do I fix this issue?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Finding an answer from the wp sessions author

    PS the next version is being returned to PHP sessions

    Mike, which version of the WP_Session object did you wrap in to the plugin?

    Looking into the code, a couple of things are happening.

    First, the garbage collection routine is registered on the wp hook, which isn’t run on the back end unless you’re doing a query. So refreshing the dashboard won’t do anything.

    Second, the wp_session_garbage_collection hook is scheduled to run twice daily. So while sessions are only valid for a certain period of time (~30 mins, unless you configure it otherwise) they stay in the database until the garbage collector runs.

    You can verify that the scheduled event is in the Cron in a debug environment by:

    1. Setting WP_DEBUG to true
    2. Installing the Debug Bar plugin
    3. Installing Debug Bar Cron

    You should see the wp_session_garbage_collection event in the custom events section as in this screenshot:

    It has version 1.1

    Hi Mike

    I am also finding tonnes of _wp_session entries in the DB – the DB is getting very bloated. Is there any way to solve this as a fix?


    Thanks Mike, reverting back to PHP sessions would be great.

    Any rough ETA when this will happen?

    Maybe a week
    Just have to find the time


    I still do not think the garbage collection works at all, you might want to check your code again.

    I have 3800 rows of

    0 rows of

    The wp_session_cleanup function does nothing because of this.

    I suspect this is why I have been getting support posts like this
    One user found 260,487 sessions in there

    Update to Version: or higher to fix this.
    The database will be cleaned up also
    I switched back to PHP sessions because WP Sessions had issues with cache plugins.

    Just wanted to follow up on this.

    It turns out the portion of code that was registering the timeout window for sessions was lost in version 1.1, so newly created sessions were being created without any sort of timestamp (meaning the garbage collector didn’t know what to clean up). This is likely the result of too many people trying to refactor at once, and my inability to keep track of who was removing which function.

    In any case, the bug has been resolved for version 1.1.1 =>

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘wp_sessions are not auto removed’ is closed to new replies.