SessionHandlerDB class

Located in file /wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the SessionHandlerDB class also inherits all the methods and properties of: WireSessionHandler, WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
SessionHandlerDB::destroy(string $id)
boolDestroy the session indicated by the given session ID 
SessionHandlerDB::gc(int $seconds)
boolGarbage collection: remove stale sessions 
SessionHandlerDB::getModuleConfigInputfields(array $data)
InputfieldWrapperSession configuration options 
SessionHandlerDB::getModuleInfo()
(nothing) 
SessionHandlerDB::getNumSessions()
intReturn the number of active sessions in the last 5 mins (300 seconds) 
SessionHandlerDB::getSessionData($sessionID)
arrayReturn all session data for the given session ID 
SessionHandlerDB::getSessions()
arrayGet the most recent sessions 
SessionHandlerDB::hookLoginSuccess(HookEvent $event)
(nothing)Hook called after Session::loginSuccess to enforce the noPS option 
SessionHandlerDB::init()
(nothing)Initailize, called when module configuration has been populated 
SessionHandlerDB::install()
(nothing)Install sessions table
SessionHandlerDB::lockSeconds int Max number of seconds to wait to obtain DB row lock. 
SessionHandlerDB::noPS int bool Prevent more than one session per logged-in user? 
SessionHandlerDB::read(string $id)
stringRead and return data for session indicated by $id 
SessionHandlerDB::retrySeconds int Seconds after which to retry after a lock fail. 
SessionHandlerDB::uninstall()
(nothing)Drop sessions table
SessionHandlerDB::upgrade(int $fromVersion, int $toVersion)
(nothing)Upgrade module version
SessionHandlerDB::useIP int bool Track IP address? 
SessionHandlerDB::useUA int bool Track user agent? 
SessionHandlerDB::wired()
(nothing)Initialize the save handler when $modules sets the current instance 
SessionHandlerDB::write(string $id, string $data)
boolWrite the given $data for the given session ID 

Additional methods and properties

In addition to the methods and properties above, SessionHandlerDB also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #519
    In the 519th issue of ProcessWire Weekly we'll check out a new third party module called RockForms, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 20 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.