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

  • Resolved Qcybb

    (@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?

    http://wordpress.org/extend/plugins/si-contact-form/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Mike Challis

    (@mikechallis)

    Finding an answer from the wp sessions author
    http://wordpress.org/support/topic/garbage-collection-not-working

    PS the next version is being returned to PHP sessions

    Eric Mann

    (@ericmann)

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

    Eric Mann

    (@ericmann)

    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: http://d.pr/i/YPLQ

    Mike Challis

    (@mikechallis)

    It has version 1.1

    Iamhere

    (@iamhere)

    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

    Thread Starter Qcybb

    (@qcybb)

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

    Any rough ETA when this will happen?

    Mike Challis

    (@mikechallis)

    Maybe a week
    Just have to find the time

    Eric,

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

    I have 3800 rows of
    _wp_session_[session_id]

    0 rows of
    _wp_session_expires_[session_id]

    The wp_session_cleanup function does nothing because of this.

    I suspect this is why I have been getting support posts like this
    http://wordpress.org/support/topic/vcita-wp_sessions-being-added-to-wp_options-table
    One user found 260,487 sessions in there

    Update to Version: 3.1.8.2 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 => http://wordpress.org/plugins/wp-session-manager/

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