Title: Do not use PHP sessions
Last modified: March 16, 2017

---

# Do not use PHP sessions

 *  [r-a-y](https://wordpress.org/support/users/r-a-y/)
 * (@r-a-y)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/do-not-use-php-sessions/)
 * Hi,
 * Can you please rewrite your code to not use a PHP session (`session_start()`)?
   If you do need to use a PHP session, then please close the session when you are
   done accessing your requried data with `session_write_close()`.
 * Since WPAC doesn’t close the PHP session, this can affect other portions of the
   WP site and other plugins, while also drastically hindering performance.
 * Read the following article about PHP sessions and WordPress (especially the “
   Exclusive Locks” section):
    [https://pressjitsu.com/blog/wordpress-sessions-performance/](https://pressjitsu.com/blog/wordpress-sessions-performance/)
 * I had to manually check if there was a PHP session and then I had to close it
   so it would’t affect one of my plugins.
 * Could probably be the cause of this issue as well:
    [https://wordpress.org/support/topic/critical-issue-wp-ajaxify-comments-causes-504-errors-on-site/](https://wordpress.org/support/topic/critical-issue-wp-ajaxify-comments-causes-504-errors-on-site/)

The topic ‘Do not use PHP sessions’ is closed to new replies.

 * ![](https://ps.w.org/wp-ajaxify-comments/assets/icon-256x256.png?rev=2962290)
 * [Ajaxify Comments - Ajax and Lazy Loading Comments](https://wordpress.org/plugins/wp-ajaxify-comments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-ajaxify-comments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ajaxify-comments/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ajaxify-comments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ajaxify-comments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ajaxify-comments/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [r-a-y](https://wordpress.org/support/users/r-a-y/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/do-not-use-php-sessions/)
 * Status: not resolved