Actions

API15

JSessionStorageMemcache/write

From Joomla! Documentation

< API15:JSessionStorageMemcache
Revision as of 12:49, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Description

Write session data to the SessionHandler backend.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

write($id, $session_data)
Parameter Name Default Value Description
$id $id The session identifier.
$session_data $session_data The session data.

Returns

boolean True on success, false otherwise.

Defined in

libraries/joomla/session/storage/memcache.php

Importing

jimport( 'joomla.session.storage.memcache' );

Source Body

function write($id, $session_data)
{
        $sess_id = 'sess_'.$id;
        if ($this->_db->get($sess_id.'_expire')) {
                $this->_db->replace($sess_id.'_expire', time(), 0);
        } else {
                $this->_db->set($sess_id.'_expire', time(), 0);
        }
        if ($this->_db->get($sess_id)) {
                $this->_db->replace($sess_id, $session_data, $this->_compress);
        } else {
                $this->_db->set($sess_id, $session_data, $this->_compress);
        }
        return;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />