final public function update($sessId, $userdata = array())
    {

        if (empty($sessId)) {
            return false;
        }

        $self = $this;

        //updates a started session for exp time
        //stores data for the registry
        $now = time();
        $newExpires = $now + $self->life;

        $update = array(
            "session_lastactive" => $now,
            "session_expires" => $newExpires
        );
        $self->id = $sessId;

        //If isset registry and is not empty, store userdata;
        if (isset($self->registry) && is_array($self->registry)) {
            $userdata = $this->input->serialize($self->registry);
            $update["session_registry"] = $userdata;
        }
        //Read the session
        $handler = $this->handler;
        //Must be called before the sesion start to generate the Id
        session_id($sessId);
        //session_start();

        if (!$handler->update($update, $self, $self->id)) {
            return false;
        }

        return true;
    }