Sitellite Application Framework
Class Tree         Index         All Elements

Class: SessionStore_PHP

Source Location: Program_Root/Session/Store/PHP.php

Class Overview

SessionStore
   |
   --SessionStore_PHP

This is the base store driver package for saf.Session. Custom drivers are created by sub-classing this package.


Author(s)

Version

  • 1.4, 2003-08-10, $Id: PHP.php,v 1.2 2005/07/06 15:30:56 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods

Class: SessionStore

SessionStore::SessionStore()
Constructor method.
SessionStore::close()
Closes the session with the store, erasing the values for this session.
SessionStore::get()
Retrieves a value from the session store. Returns false if the value does not exist.
SessionStore::save()
Tells the session store to save the values within it.
SessionStore::set()
Sets a value in the session store. If the value is false, it will unset it in the store. If the value is being unset or set to a new value, then the old value is returned. If it is a new value, then the value itself will be returned.
SessionStore::setProperties()
Sets the properties of this object.
SessionStore::start()
Starts the session store, initializing any necessary connections, and retrieving any session values found from a previous web page request.

Class Details

[line 86]
This is the base store driver package for saf.Session. Custom drivers are created by sub-classing this package.

New in 1.2:

  • Fixed an issue where session_set_cookie_params() was causing duplicate cookies to be set, which could cause lockouts upon multiple login/logout attempts.
  • Silenced the session_destroy() method in close(), which under some conditions was calling session_destroy() on an already-destroyed session.
New in 1.4:
  • Decided against naming the session cookie the same as the SCS session cookie. It was causing too many problems.

1 <?php
2
3 $s = new SessionStore;
4
5 $s->setProperties (array (
6 'foo' => 'bar',
7 ));
8
9 if ($s->start ($id)) {
10 // connected
11
12 // set a few session variables
13 $s->set ('name', 'Joe');
14 $s->set ('age', '24');
15
16 // get the value of 'name'
17 $name =$s->get ('name');
18
19 // rename 'name'
20 $oldname = $s->set ('name', 'Jack');
21
22 // unset 'age'
23 $s->set ('age', false);
24
25 // remember these for next time
26 $s->save ();
27 } else {
28 // not connected
29 echo $s->error;
30 }
31
32 ? >




Tags:

access:  public
version:  1.4, 2003-08-10, $Id: PHP.php,v 1.2 2005/07/06 15:30:56 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$cookiedomain =  ''

[line 120]

Domain value of the cookie.



Tags:

access:  public

Type:   mixed


[ Top ]

$cookieexpires =  false

[line 104]

The lifetime of the session cookie.



Tags:

access:  public

Type:   mixed


[ Top ]

$cookiepath =  '/'

[line 128]

Path value of the cookie. Defaults to '/'.



Tags:

access:  public

Type:   mixed


[ Top ]

$cookiesecure =  0

[line 112]

If 1 then the cookie will only be sent over secure connections.



Tags:

access:  public

Type:   mixed


[ Top ]

$session_name =  'sitellite_session_id'

[line 96]

The error message if an error occurs. Defaults to 'sitellite_session_id'.



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


constructor SessionStore_PHP [line 138]

SessionStore_PHP SessionStore_PHP( )

Constructor method.



Tags:

access:  public


[ Top ]

method close [line 237]

void close( )

Closes the session with the store, erasing the values for this session.



Tags:

access:  public


Overrides SessionStore::close() (Closes the session with the store, erasing the values for this session.)

[ Top ]

method get [line 181]

mixed get( string $name)

Retrieves a value from the session store. Returns false if the value does not exist.



Tags:

access:  public


Overrides SessionStore::get() (Retrieves a value from the session store. Returns false if the value does not exist.)

Parameters:

string   $name  

[ Top ]

method save [line 225]

boolean save( )

Tells the session store to save the values within it.



Tags:

access:  public


Overrides SessionStore::save() (Tells the session store to save the values within it.)

[ Top ]

method set [line 202]

mixed set( string $name, [mixed $value = false])

Sets a value in the session store. If the value is false, it will unset it in the store. If the value is being unset or set to a new value, then the old value is returned. If it is a new value, then the value itself will be returned.



Tags:

access:  public


Overrides SessionStore::set() (Sets a value in the session store. If the value is false, it will unset it in the store. If the value is being unset or set to a new value, then the old value is returned. If it is a new value, then the value itself will be returned.)

Parameters:

string   $name  
mixed   $value  

[ Top ]

method start [line 153]

boolean start( [string $id = false])

Starts the session store, initializing any necessary connections, and retrieving any session values found from a previous web page request.

$id is the session identifier of the current visitor.




Tags:

access:  public


Overrides SessionStore::start() (Starts the session store, initializing any necessary connections, and retrieving any session values found from a previous web page request.)

Parameters:

string   $id  

[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:18:42 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2