0 follower

Interface Yiisoft\Session\SessionInterface

Implemented byYiisoft\Session\NullSession, Yiisoft\Session\Session

Session interface defines session data management API.

Public Methods

Hide inherited methods

Method Description Defined By
all() Yiisoft\Session\SessionInterface
clear() Remove session data from runtime. Yiisoft\Session\SessionInterface
close() Write session and close it. Yiisoft\Session\SessionInterface
destroy() Remove session data from runtime and session storage. Yiisoft\Session\SessionInterface
discard() Discard session changes and close session. Yiisoft\Session\SessionInterface
get() Read value from session. Yiisoft\Session\SessionInterface
getCookieParameters() Yiisoft\Session\SessionInterface
getId() Yiisoft\Session\SessionInterface
getName() Yiisoft\Session\SessionInterface
has() Check if session has a value with a given key. Yiisoft\Session\SessionInterface
isActive() Yiisoft\Session\SessionInterface
open() Start session if it is not started yet. Yiisoft\Session\SessionInterface
pull() Read value and remove it afterwards. Yiisoft\Session\SessionInterface
regenerateId() Regenerate session ID keeping data. Yiisoft\Session\SessionInterface
remove() Remove value from session. Yiisoft\Session\SessionInterface
set() Write value into session. Yiisoft\Session\SessionInterface
setId() Yiisoft\Session\SessionInterface

Method Details

Hide inherited methods

all() public abstract method

public abstract array all ( )
return array

All session data.

                public function all(): array;

            
clear() public abstract method

Remove session data from runtime.

public abstract void clear ( )

                public function clear(): void;

            
close() public abstract method

Write session and close it.

public abstract void close ( )

                public function close(): void;

            
destroy() public abstract method

Remove session data from runtime and session storage.

public abstract void destroy ( )

                public function destroy(): void;

            
discard() public abstract method

Discard session changes and close session.

public abstract void discard ( )

                public function discard(): void;

            
get() public abstract method

Read value from session.

public abstract mixed get ( string $key, mixed $default null )
$key string

Key to read value from.

$default mixed

Default value in case there is no value with the key specified. Null by default.

                public function get(string $key, $default = null);

            
getCookieParameters() public abstract method

public abstract array getCookieParameters ( )
return array

Parameters for a session cookie.

                public function getCookieParameters(): array;

            
getId() public abstract method

public abstract string|null getId ( )
return string|null

Current session ID or null if there is no started session.

                public function getId(): ?string;

            
getName() public abstract method

public abstract string getName ( )
return string

Session name.

                public function getName(): string;

            
has() public abstract method

Check if session has a value with a given key.

public abstract boolean has ( string $key )
$key string

The key to check.

                public function has(string $key): bool;

            
isActive() public abstract method

public abstract boolean isActive ( )
return boolean

If session is started.

                public function isActive(): bool;

            
open() public abstract method

Start session if it is not started yet.

public abstract void open ( )

                public function open(): void;

            
pull() public abstract method

Read value and remove it afterwards.

public abstract mixed pull ( string $key, mixed $default null )
$key string

The key to pull value from.

$default mixed

Default value in case there is no value with the key specified. Null by default.

return mixed

The value.

                public function pull(string $key, $default = null);

            
regenerateId() public abstract method

Regenerate session ID keeping data.

public abstract void regenerateId ( )

                public function regenerateId(): void;

            
remove() public abstract method

Remove value from session.

public abstract void remove ( string $key )
$key string

                public function remove(string $key): void;

            
set() public abstract method

Write value into session.

public abstract void set ( string $key, mixed $value )
$key string

Key to write value to.

$value mixed

Value to write.

                public function set(string $key, $value): void;

            
setId() public abstract method

public abstract void setId ( string $sessionId )
$sessionId string

Set session ID.

                public function setId(string $sessionId): void;