WireSessionHandler class

Located in file /wire/core/WireSessionHandler.php

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

Show class?             Show args?        

Common

NameReturnSummary 
WireSessionHandler::attach()
(nothing)Attach this as the session handler 
WireSessionHandler::close()
boolClose the session 
WireSessionHandler::destroy(string $id)
boolDestroy the session indicated by the given session ID 
WireSessionHandler::gc(int $seconds)
boolGarbage collection: remove stale sessions 
WireSessionHandler::hookSessionInit(HookEvent $event)
(nothing)Hook before Session::init 
WireSessionHandler::init()
(nothing)Initailize, called when module configuration has been populated 
WireSessionHandler::isAutoload()
(nothing)Tells the Modules API to automatically load this module at boot 
WireSessionHandler::isSingular()
(nothing)Tells the Modules API to only instantiate one instance of this module 
WireSessionHandler::open(string $path, string $name)
boolOpen the session 
WireSessionHandler::read(string $id)
stringRead and return data for session indicated by $id 
WireSessionHandler::sessionExists()
boolDoes a session currently exist? (i.e. already one started) 
WireSessionHandler::wired()
(nothing)Initialize the save handler when $modules sets the current instance 
WireSessionHandler::write(string $id, $data)
(nothing)Write the given $data for the given session ID 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #540
    In the 540th issue of ProcessWire Weekly we'll check out the latest core updates, introduce a new third party module called Page List Custom Sort, and more. Read on!
    Weekly.pw / 14 September 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

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer