Welcompose
[ class tree: Welcompose ] [ index: Welcompose ] [ all elements ]

Class: Base_Cookie

Source Location: /base_classes/cookie.class.php

Class Overview


Project: Welcompose File: cookie.class.php


Author(s):

  • Andreas Ahlenstorf

Copyright:

  • 2008 creatics, Olaf Gleba

Variables

Methods



Class Details

[line 25]
Project: Welcompose File: cookie.class.php

Copyright (c) 2008 creatics

Project owner: creatics, Olaf Gleba 50939 Köln, Germany http://www.creatics.de

This file is licensed under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE v3 http://www.opensource.org/licenses/agpl-v3.html

$Id: cookie.class.php 48 2007-01-19 15:49:28Z andreas $




Tags:

author:  Andreas Ahlenstorf
copyright:  2008 creatics, Olaf Gleba
license:  GNU AFFERO GENERAL PUBLIC LICENSE v3


[ Top ]


Class Variables

$rc4 =  null

[line 31]

PEAR::Crypt_RC4 object



Tags:

access:  protected

Type:   object


[ Top ]

$_app_key =  null

[line 37]

Secret to be used to encrypt the cookie contents



Tags:

access:  protected

Type:   string


[ Top ]

$_cookie_name =  null

[line 43]

Name of the cookie



Tags:

access:  protected

Type:   string


[ Top ]

$_data =  null

[line 49]

Data to be saved in the cookie



Tags:

access:  protected

Type:   mixed


[ Top ]

$_expiration =  null

[line 55]

Expiration date of the cookie (offset to gmmktime())



Tags:

access:  protected

Type:   int


[ Top ]

$_path =  "/"

[line 61]

Cookie path



Tags:

access:  protected

Type:   string


[ Top ]

$_taint_silent =  true

[line 69]

How to react when cookie is tainted. If set to true, getCookieData() will simply return null. If set to false, an exception will be thrown.



Tags:

access:  protected

Type:   bool


[ Top ]



Class Methods


constructor __construct [line 80]

Base_Cookie __construct( string $app_key, string $cookie_name)

Creates new cookie object. Takes application key to be used to encrypt the cookie contents as first argument, the cookie name as second argument.



Tags:

throws:  Base_CookieException
access:  public


Parameters:

string   $app_key   Application key
string   $cookie_name   Cookie name

[ Top ]

method deleteCookie [line 252]

void deleteCookie( )

Deletes cookie.



Tags:

access:  public


[ Top ]

method getCookieData [line 140]

mixed getCookieData( )

Returns cookie data. If Base_Cookie::setCookieData() has been called before, you'll get the data created by the last Base_Cookie::setCookieData() call. To retrieve the original cookie data, use Base_Cookie::getInitialCookieData().



Tags:

access:  public


[ Top ]

method getInitialCookieData [line 150]

mixed getInitialCookieData( )

Returns initial cookie data (from startup).



Tags:

access:  public


[ Top ]

method readCookieData [line 208]

bool readCookieData( )

Reads data from cookie and stores retrived data to Base_Cookie::_data.

If the received cookie data is tainted, the method will either return boolean false or throw an exception -- behaviour depends on Base_Cookie:_taint_silent.




Tags:

throws:  Base_CookieException
access:  protected


[ Top ]

method setCookie [line 127]

bool setCookie( )

Sets cookie using the data structure defined in Base_Cookie::data.



Tags:

access:  public


[ Top ]

method setCookieData [line 117]

void setCookieData( mixed $data)

Sets cookie data.



Tags:

access:  public


Parameters:

mixed   $data  

[ Top ]

method setCookieExpiration [line 268]

int setCookieExpiration( int $offset)

Sets new value for cookie expiration offset to GMT. Takes the new offset as first argument. Returns new expiration offset.



Tags:

return:  Offset in seconds
access:  public


Parameters:

int   $offset   Offset in seconds

[ Top ]

method setCookiePath [line 284]

string setCookiePath( string $path)

Sets new cookie path. Takes a string with the new cookie path as first argument. Returns new cookie path.



Tags:

return:  Cookie path
access:  public


Parameters:

string   $path   Cookie path

[ Top ]

method setTaintSilent [line 300]

bool setTaintSilent( bool $state)

Sets new state for Base_Cookie::_taint_silent. Takes boolean state as first argument. Returns new boolean state.



Tags:

access:  public


Parameters:

bool   $state  

[ Top ]

method writeCookieData [line 164]

bool writeCookieData( )

Writes data to cookie, or to be correct, to two cookies. One cookie will be filled with the serialized, encrypted data and the second one (name prefixed with "_fingerprint") will be filled with a fingerprint to verify the encrypted data. Returns bool.



Tags:

throws:  Base_CookieException
access:  protected


[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:45 +0100 by phpDocumentor 1.4.3