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 #553
    In the 553rd issue of ProcessWire Weekly we'll check out the latest weekly update from Ryan, introduce a new third party module called Text Synthesis, and more. Read on!
    Weekly.pw / 14 December 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer