The Yaf_Session class

(Yaf >=1.0.0)

Introduction

Yaf_Session is a namespaced wrapper around PHP's native session support. It is accessed as a singleton through Yaf_Session::getInstance() and works directly on $_SESSION: session data written through one interface is visible in the other.

Session entries can be accessed and manipulated through property syntax, method calls (Yaf_Session::get(), Yaf_Session::set(), Yaf_Session::del(), Yaf_Session::has()), array access (ArrayAccess), iteration (Iterator) and count().

Class synopsis

class Yaf_Session implements Iterator, ArrayAccess, Countable {
/* Properties */
protected static $_instance;
protected $_session;
protected $_started;
/* Methods */
privatefunction __construct()
public function count(): int
public function current(): mixed
public function del(string $name): bool
public function get(string $name = NULL): mixed
public static function getInstance(): Yaf_Session
public function has(string $name): bool
public function __isset(string $name): bool
public function key(): mixed
public function next(): void
public function offsetExists(mixed $name): bool
public function offsetGet(mixed $name): mixed
public function offsetSet(mixed $name, mixed $value): void
public function offsetUnset(mixed $name): void
public function rewind(): void
public function set(string $name, mixed $value): bool
public function start(): Yaf_Session
public function __unset(string $name): void
public function valid(): bool
}

Properties

_instance

_session

_started

Table of Contents

add a note

User Contributed Notes

There are no user contributed notes for this page.