LLMS_Abstract_Session_Data::get( string $key, mixed $default = false )

Retrieve a session variable.


Description Description


Parameters Parameters

$key

(string) (Required) The key of the session variable.

$default

(mixed) (Optional) The default value to return if no session variable is found with the provided key. Default false.

Default value: false


Top ↑

Return Return

(mixed)


Top ↑

Source Source

File: includes/abstracts/llms-abstract-session-data.php

	public function get( $key, $default = false ) {

		$key = sanitize_key( $key );
		return isset( $this->data[ $key ] ) ? maybe_unserialize( $this->data[ $key ] ) : $default;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Moved from LLMS_Session.
3.37.7 Added the $default parameter that represents the default value to return if the session variable requested doesn't exist.
1.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.