Skip to content
Docs
Get RestroPress

Action

wp_session_commit

Updated
On this page

Fires after session data has been written at the end of the request.

Runs from wp_session_write_close, which is attached to shutdown. The session data has already been saved when it fires. It takes no arguments.

Example#

function my_after_session_commit() {
	error_log( 'Session written' );
}
add_action( 'wp_session_commit', 'my_after_session_commit' );

Notes#

Also fires when wp_session_commit() is called directly, since that function is an alias of wp_session_write_close().

Source#

Fired from:

  • includes/libraries/wp-session.php (line 98), in wp_session_write_close()
  • includes/libraries/wp_session/wp-session.php (line 100), in wp_session_write_close()

See also#

Was this page helpful?