Sitellite Application Framework
Class Tree         Index         All Elements

Class: SessionHandler_Cookie

Source Location: Program_Root/Session/Handler/Cookie.php

Class Overview

SessionHandler
   |
   --SessionHandler_Cookie

Provides a Cookie-based authentication client handler to the saf.Session Package.


Author(s)

Version

  • 1.2, 2002-11-09, $Id: Cookie.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: SessionHandler

SessionHandler::SessionHandler()
Constructor method.
SessionHandler::changeTimeout()
Resets the client info with a new timeout value.
SessionHandler::close()
Closes the session with the user.
SessionHandler::sendAuthRequest()
Sends an authorization request to the user.
SessionHandler::setProperties()
Sets the properties of this object.
SessionHandler::start()
Initializes the communication with the client.

Class Details

[line 64]
Provides a Cookie-based authentication client handler to the saf.Session Package.

New in 1.2:

  • Added a $cookieexpires property, so you can have sessions that can expire in a certain amount of time, not just when the browser closes.

1 <?php
2
3 $c = new SessionHandler_Cookie;
4
5 $c->cookiename = 'sessid';
6 $c->cookiedomain = 'www.sitename.com';
7
8 // or
9
10 $c->setProperties (array (
11 'cookiename' => 'sessid',
12 'cookiedomain' => 'www.sitename.com',
13 ));
14
15 $c->sendAuthRequest ();
16
17 ? >




Tags:

access:  public
version:  1.2, 2002-11-09, $Id: Cookie.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 91]

Domain value of the cookie.



Tags:

access:  public

Type:   mixed


[ Top ]

$cookieexpires =  0

[line 83]

Expiration of cookie. Defaults to 0, which means the cookie will expire when the browser closes.



Tags:

access:  public

Type:   mixed


[ Top ]

$cookiename =  'sitellite_session_id'

[line 74]

Name of the cookie. Defaults to 'sitellite_session_id'.



Tags:

access:  public

Type:   mixed


[ Top ]

$cookiepath =  '/'

[line 99]

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



Tags:

access:  public

Type:   mixed


[ Top ]

$cookiesecure =  0

[line 107]

Secure value of the cookie. May be 1 or 0, and defaults to 0.



Tags:

access:  public

Type:   mixed


[ Top ]

$formmessage =  'Please enter your username and password.'

[line 197]

The welcome message of the form. Defaults to 'Please enter your username and password.'



Tags:

access:  public

Type:   mixed


[ Top ]

$formtemplate =  false

[line 170]

The template of the form created by sendAuthRequest().

Defaults to false (no template).




Tags:

access:  public

Type:   mixed


[ Top ]

$hiddenfields = array ()

[line 134]

A list of hidden form fields and their values.



Tags:

access:  public

Type:   mixed


[ Top ]

$invalidmessage =  'Sorry, the password you specified was invalid. Please try again.'

[line 206]

The invalid message of the form. Defaults to 'Sorry, the password you specified was invalid. Please try again.'



Tags:

access:  public

Type:   mixed


[ Top ]

$passwordfield =  'password'

[line 126]

The name of the password field in the form created by sendAuthRequest(). Defaults to 'password'.



Tags:

access:  public

Type:   mixed


[ Top ]

$passwordrules = array ()

[line 188]

A list of rules for the password form field. The keys are the rules and the values are the invalid messages.



Tags:

access:  public

Type:   mixed


[ Top ]

$passwordtext =  'Password'

[line 152]

The alt text of the password field in the form created by sendAuthRequest(). Defaults to 'Password'.



Tags:

access:  public

Type:   mixed


[ Top ]

$submittext =  'Sign In'

[line 161]

The alt text of the submit button in the form created by sendAuthRequest(). Defaults to 'Sign In'.



Tags:

access:  public

Type:   mixed


[ Top ]

$timeoutmessage =  'Sorry, your session has timed out.  Please sign in again to continue.'

[line 215]

The timeout message of the form. Defaults to 'Sorry, your session has timed out. Please sign in again to continue.'



Tags:

access:  public

Type:   mixed


[ Top ]

$usernamefield =  'username'

[line 117]

The name of the username field in the form (uses saf.MailForm) created by sendAuthRequest(). Defaults to 'username'.



Tags:

access:  public

Type:   mixed


[ Top ]

$usernamerules = array ()

[line 179]

A list of rules for the username form field. The keys are the rules and the values are the invalid messages.



Tags:

access:  public

Type:   mixed


[ Top ]

$usernametext =  'Username'

[line 143]

The alt text of the username field in the form created by sendAuthRequest(). Defaults to 'Username'.



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


method changeTimeout [line 249]

void changeTimeout( integer $newduration)

Re-sends the session cookie with a new timeout value.



Tags:

access:  public


Overrides SessionHandler::changeTimeout() (Resets the client info with a new timeout value.)

Parameters:

integer   $newduration  

[ Top ]

method close [line 342]

void close( )

Unsets the session cookie.



Tags:

access:  public


Overrides SessionHandler::close() (Closes the session with the user.)

[ Top ]

method gatherParameters [line 328]

array gatherParameters( [string/boolean $sessionidname = 'sitellite_session_id'])

Provides values for the username, password, and session id (if applicable) to the main Session object. This is passed off to the handlers because they know more about the client than the main object does.



Tags:

access:  public


Parameters:

string/boolean   $sessionidname  

[ Top ]

method sendAuthRequest [line 262]

void sendAuthRequest( )

Sends the request for a username and password. This would be an HTML form in this case.



Tags:

access:  public


Overrides SessionHandler::sendAuthRequest() (Sends an authorization request to the user.)

[ Top ]

method start [line 230]

boolean start( string $id, [boolean $authorized = false])

Initializes the communication with the client. In the case of this handler, if the $authorized value is true it sets the session cookie with the $id value.



Tags:

access:  public


Overrides SessionHandler::start() (Initializes the communication with the client.)

Parameters:

string   $id  
boolean   $authorized  

[ Top ]


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