Session::set( string $key, mixed|null $val = null )
Description #
Set offset in AnsPress session.
Parameters #
- $keystring (Required) Offset key.
- $valmixed | null (Optional) Offset value. Delete key value pair if this is
null
. Default value: null
Source #
File: includes/class/class-session.php
public function set( $key, $val = null ) { $cache = get_transient( 'anspress_session_' . $this->id ); if ( false === $cache ) { $cache = array( $key => $val ); } $cache[ $key ] = $val; set_transient( 'anspress_session_' . $this->id, $cache, $this->expires ); }
Expand full source code Collapse full source code View on GitHub: includes/class/class-session.php:152
Add your comment