Skip to content

Instantly share code, notes, and snippets.

@ericsk
Created December 30, 2013 15:00

Revisions

  1. ericsk created this gist Dec 30, 2013.
    28 changes: 28 additions & 0 deletions windowsazuresessionhandler.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    /**
    * Callback function for session handler. It's invoked while the session is being opened.
    *
    * @param $savePath The path to store the session.
    * @param $sessionName The name of the session.
    *
    * @return boolean If the open operation success.
    */
    public function open($savePath, $sessionName) {
    try {
    // get table to see if the table exists.
    $this->_tableRestProxy->getTable($this->_sessionContainer);
    } catch (ServiceException $e) {
    // cannot get the table, so create it
    $this->_tableRestProxy->createTable($this->_sessionContainer);
    }
    return TRUE;
    }

    /**
    * Callback function for session handler. It's invoked while the session is being closed.
    *
    * @return boolean If the close operation success.
    */
    public function close() {
    // do nothing
    return TRUE;
    }