Session::delete( null|string $key = null )

Description #

Delete all session data or just a key=>value pair.

Parameters #

  • $key
    null | string (Optional) Name of key. On null all session data is deleted. Default value: null

Changelog #

VersionDescription
4.1.5Introduced.

Source #

File: includes/class/class-session.php

	public function delete( $key = null ) {
		// Delete all session data if no key set.
		if ( null === $key ) {
			delete_transient( 'anspress_session_' . $this->id );
			return;
		}

		$this->set( $key );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment