rfc:session-oo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
rfc:session-oo [2011/06/03 00:44] – created arpadrfc:session-oo [2011/06/03 01:00] – slightly more useful example arpad
Line 22: Line 22:
 ===== Example ===== ===== Example =====
  
-<code>+<code php>
 <?php <?php
 class MySession extends SessionHandler { class MySession extends SessionHandler {
- public static function open($path, $name) { 
- echo 'Open ', session_id(), "\n"; 
- return parent::open($path, $name); 
- } 
  public static function read($key) {  public static function read($key) {
- echo 'Read ', session_id(), "\n"+ return str_rot13(parent::read($key)); 
- return parent::read($key);+
 + 
 + public static function write($key, $data) { 
 + return parent::write($key, str_rot13($data));
  }  }
 } }
rfc/session-oo.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1