rfc:user_defined_session_serializer

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:user_defined_session_serializer [2016/11/17 10:50] – Add more descriptions. yohgakirfc:user_defined_session_serializer [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: User defined session serializer ====== ====== PHP RFC: User defined session serializer ======
-  * Version: 0.9+  * Version: 1.0
   * Date: 2016-11-17   * Date: 2016-11-17
   * Author: Yasuo Ohgaki <yohgaki@ohgaki.net>   * Author: Yasuo Ohgaki <yohgaki@ohgaki.net>
-  * Status: Under Discussion+  * Status: Declined
   * First Published at: http://wiki.php.net/rfc/user_defined_session_serializer   * First Published at: http://wiki.php.net/rfc/user_defined_session_serializer
  
 ===== Introduction ===== ===== Introduction =====
  
-Currently, only C module can add additional session data serializer. If there is user defined serializer, users can+Currently, only C module can add additional session data serializer. With user defined session data serializer, users can
  
   * Encrypt/decrypt session data transparently.   * Encrypt/decrypt session data transparently.
Line 28: Line 28:
 $serialize_func = function(array $session_data_array) { $serialize_func = function(array $session_data_array) {
   // User can add/encrypt data in this function   // User can add/encrypt data in this function
-  return serialize($session_data_array);+  // Returning anything other than string raises E_RECOVERABLE_ERROR 
 +  return serialize($session_data_array); // Must return string
 } }
  
 $unserialize_func = function(string $session_data_string) { $unserialize_func = function(string $session_data_string) {
   // User can remove/decrypt/validate data in this function   // User can remove/decrypt/validate data in this function
-  return unserialize($session_data_string);+  // Returning anything other than array raises E_RECOVERABLE_ERROR 
 +  return unserialize($session_data_string); // Must return array
 } }
 </code> </code>
Line 46: Line 48:
 </code> </code>
  
-These function/methods are called before reading/writing session data to session data database.+session_set_serializer() accepts object implements SessionSerializerInterface. 
 + 
 +<code php> 
 +bool session_set_serializer(SessionSerializerInterface $handler) 
 +</code> 
 + 
 +These functions/methods are called before reading/writing session data to session data database.
  
 Please refer to the pull request phpt files for usage details.  Please refer to the pull request phpt files for usage details. 
Line 66: Line 74:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
-50%+1 majority is required to pass.+2/3 majority is required to pass.
  
-<doodle title="Add user defined session serializer" auth="yohgaki" voteType="single" closed="true">+Vote starts: 2016-12-05  Vote ends: 2016-12-19 UTC 23:59:59 
 + 
 +<doodle title="Add user defined session serializer" auth="yohgaki" voteType="single" closed="false">
    * Yes    * Yes
    * No    * No
 </doodle> </doodle>
  
-Vote starts: 2016-XX-XX 
- 
-Vote ends: 2016-XX-XX UTC 23:59:59 
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
rfc/user_defined_session_serializer.1479379838.txt.gz · Last modified: 2017/09/22 13:28 (external edit)