This page provides a full overview of PHP's SessionHandler
life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and
what you can expect will be called in your custom SessionHandler implementation.
The <?php tag in the following indicates the start of a new script request made by a client with cookies
enabled.
To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().
Output on the left side (from echo statements) is indicated by an extra level of indentation.
<?php
session_start();
# SessionHandler::open('C:\\server\\temp', 'PHPSESSID')
# SessionHandler::create_sid()
# SessionHandler::read('f57cvufkbu6qgfiqkksuagl257')
$_SESSION['foo'] = 'bar';
session_write_close();
# SessionHandler::write('f57cvufkbu6qgfiqkksuagl257', 'foo|s:3:"bar";')
# SessionHandler::close()<?php
session_start();
# SessionHandler::open('C:\\server\\temp', 'PHPSESSID')
# SessionHandler::read('f57cvufkbu6qgfiqkksuagl257')
echo $_SESSION['foo'];
bar
session_write_close();
# SessionHandler::write('f57cvufkbu6qgfiqkksuagl257', 'foo|s:3:"bar";')
# SessionHandler::close()<?php
session_start();
# SessionHandler::open('C:\\server\\temp', 'PHPSESSID')
# SessionHandler::read('f57cvufkbu6qgfiqkksuagl257')
session_regenerate_id();
# SessionHandler::create_sid()
echo $_SESSION['foo'];
bar
session_write_close();
# SessionHandler::write('dp1srap0fn9isne4na6mm83mt4', 'foo|s:3:"bar";')
# SessionHandler::close()<?php
session_reset();
session_write_close();<?php
session_start();
# SessionHandler::open('C:\\server\\temp', 'PHPSESSID')
# SessionHandler::read('dp1srap0fn9isne4na6mm83mt4')
session_destroy();
# SessionHandler::destroy('dp1srap0fn9isne4na6mm83mt4')
# SessionHandler::close()
Good overview but like for my you missed better implementation of sid creation, made of all characters like in original , default session handler implementation.