EPL_Session Class
| Since | |
|---|---|
3.4.15 |
|
| Methods | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct()
Get things started
Get things started Defines our WP_Session constants, includes the necessary libraries and retrieves the WP Session instance Since
|
# | ||||||||
public
|
init(): array|WP_Session
Setup the WP_Session instance
Setup the WP_Session instance Loads the visitor's existing session. A new session is only started when something is stored in it (see set()), so pages for visitors without a session send no session cookie and can be cached. Since
|
# | ||||||||
public
|
lazy_session(): bool
Start the session only when something is stored in it?
Start the session only when something is stored in it? Since
|
# | ||||||||
public
|
has_session_cookie(): bool
Does the request carry a session cookie?
Does the request carry a session cookie? Since
|
# | ||||||||
public
|
start_session(): bool
Start the session and send its cookie
Start the session and send its cookie Values stored before the session started are kept. ReturnsTrue when the session is started. Since
|
# | ||||||||
public
|
get_id(): string
Retrieve session ID
Retrieve session ID ReturnsSession ID Since
|
# | ||||||||
public
|
get(string $key): mixed
Retrieve a session variable
Retrieve a session variable Parameters
ReturnsSession variable Since
|
# | ||||||||
public
|
set(string $key, int|string|array $value): mixed
Set a session variable
Set a session variable Parameters
ReturnsSession variable Since
|
# | ||||||||
public
|
set_expiration_variant_time(int $exp): int
Force the cookie expiration variant time to 23 hours
Force the cookie expiration variant time to 23 hours Parameters
Since
|
# | ||||||||
public
|
set_expiration_time(int $exp): int
Force the cookie expiration time to 24 hours
Force the cookie expiration time to 24 hours Parameters
ReturnsCookie expiration time Since
|
# | ||||||||
public
|
use_php_sessions(): boolean
Starts a new session if one hasn't started yet.
Starts a new session if one hasn't started yet. Checks to see if the server supports PHP sessions or if the EPL_USE_PHP_SESSIONS constant is defined Returns$ret True if we are using PHP sessions, false otherwise. Since
|
# | ||||||||
public
|
should_start_session(): bool
Determines if we should start sessions
Determines if we should start sessions Since
|
# | ||||||||
public
|
get_blacklist(): array
Retrieve the URI blacklist
Retrieve the URI blacklist These are the URIs where we never start sessions Since
|
# | ||||||||
public
|
maybe_start_session()
Starts a new session if one hasn't started yet.
Starts a new session if one hasn't started yet. Since
|
# | ||||||||