Documentation

Core_Session
in package

AbstractYes

Sessions

Start Session Core_Session::start();

Close Session Core_Session::close();

Tags
subpackage

Core

version
7.x
copyright

© 2005-2025, https://www.hostcms.ru

Table of Contents

Properties

$_cookieLifetime  : int
Cookie Lifetime, default 31 day is 2678400
$_debug  : bool
Debug
$_domain  : string
Domain, auto-detected by default
$_error  : mixed
Error
$_handler  : mixed
Handler
$_hasSessionId  : mixed
Is the current request has sent the session ID.
$_maxlifetime  : int
Session maxlifetime
$_started  : bool
Session has been started

Methods

close()  : bool
Close session
cookieLifetime()  : mixed
Set Cookie Lifetime
correctDomain()  : string
Correct domain
debug()  : mixed
Set debug
destroy()  : bool
Destroy Session
domain()  : mixed
Set Domain
error()  : mixed
Show error
flushAll()  : mixed
Delete all sessions
getConfig()  : mixed
Get Session Config
getDomain()  : string
Get domain
getMaxLifeTime()  : int
Get session maxlifetime
getName()  : string
Get session name
hasSessionId()  : bool
The is the current request has sent the session ID.
isAcive()  : bool
Backward compatibility, see isActive()
isActive()  : bool
Checks if the session enabled and exists
isStarted()  : bool
Checks if the session was started
regenerateId()  : mixed
Regenerate session ID
sessionMaxlifetime()  : bool
This callback is executed when a session sets maxlifetime
setMaxLifeTime()  : true
Set session maxlifetime
setStarted()  : bool
Set started
start()  : bool
Start session
_getDriverName()  : srting
Get full driver name
_log()  : mixed
Log
_setSessionHandler()  : mixed
Registers session handler

Properties

$_cookieLifetime

Cookie Lifetime, default 31 day is 2678400

protected static int $_cookieLifetime = 2678400

$_debug

Debug

protected static bool $_debug = \FALSE

$_domain

Domain, auto-detected by default

protected static string $_domain = \NULL

$_error

Error

protected static mixed $_error = \NULL

$_handler

Handler

protected static mixed $_handler = \NULL

$_hasSessionId

Is the current request has sent the session ID.

protected static mixed $_hasSessionId = \NULL

$_maxlifetime

Session maxlifetime

protected static int $_maxlifetime = \NULL

$_started

Session has been started

protected static bool $_started = \FALSE

Methods

close()

Close session

public static close() : bool
Return values
bool

cookieLifetime()

Set Cookie Lifetime

public static cookieLifetime(int $lifetime) : mixed
Parameters
$lifetime : int

correctDomain()

Correct domain

public static correctDomain(mixed $domain) : string
Parameters
$domain : mixed
Return values
string

debug()

Set debug

public static debug([bool $debug = TRUE ]) : mixed
Parameters
$debug : bool = TRUE

destroy()

Destroy Session

public static destroy(string $id) : bool
Parameters
$id : string

session ID

Return values
bool

domain()

Set Domain

public static domain(string $domain) : mixed
Parameters
$domain : string

error()

Show error

public static error(string $content) : mixed
Parameters
$content : string

flushAll()

Delete all sessions

public static flushAll() : mixed

getConfig()

Get Session Config

public static getConfig() : mixed
Tags
rerurn

array

getDomain()

Get domain

public static getDomain() : string
Return values
string

getMaxLifeTime()

Get session maxlifetime

public static getMaxLifeTime() : int
Return values
int

getName()

Get session name

public static getName() : string
Return values
string

hasSessionId()

The is the current request has sent the session ID.

public static hasSessionId() : bool
Return values
bool

isAcive()

Backward compatibility, see isActive()

public static isAcive() : bool
Return values
bool

isActive()

Checks if the session enabled and exists

public static isActive() : bool
Return values
bool

isStarted()

Checks if the session was started

public static isStarted() : bool
Return values
bool

regenerateId()

Regenerate session ID

public static regenerateId([bool $delete_old_session = FALSE ]) : mixed
Parameters
$delete_old_session : bool = FALSE

Whether to delete the old associated session file or not, default FALSE

sessionMaxlifetime()

This callback is executed when a session sets maxlifetime

public sessionMaxlifetime(int $maxlifetime[, bool $overwrite = FALSE ]) : bool
Parameters
$maxlifetime : int
$overwrite : bool = FALSE

overwrite previous maxlifetime

Return values
bool

setMaxLifeTime()

Set session maxlifetime

public static setMaxLifeTime(int $maxlifetime[, bool $overwrite = FALSE ]) : true
Parameters
$maxlifetime : int
$overwrite : bool = FALSE

Overwrite maximum lifetime, default FALSE

Return values
true

setStarted()

Set started

public static setStarted() : bool
Return values
bool

start()

Start session

public static start([string|null $id = NULL ]) : bool
Parameters
$id : string|null = NULL

Session ID

Return values
bool

_getDriverName()

Get full driver name

protected static _getDriverName(string $driver) : srting
Parameters
$driver : string

driver name

Return values
srting

_log()

Log

protected static _log(string $actionName) : mixed
Parameters
$actionName : string

_setSessionHandler()

Registers session handler

protected static _setSessionHandler() : mixed

        
On this page

Search results