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

Class: Cookie

Source Location: /cookie.php

Class Overview


Cookie


Author(s):

Version:

  • 0.1.2

Variables

Methods



Class Details

[line 50]
Cookie

An md5 encrypted cookie, which times out after $expiration seconds. After you authenticate a user, set a cookie to securely and transparently propagate the user's id. Set $cookie->key to a unique string before set() and validate().

Usage:

  1.  function set_cookie({
  2.    $cookie new Cookie();
  3.    $cookie->userid "foobar";
  4.    $cookie->set();
  5.  }
  6.  
  7.  function check_cookie({
  8.   $cookie new Cookie();
  9.   if ($cookie->validate()) {
  10.    print "cookie is good";
  11.   else {
  12.    print "cookie is not good";
  13.   }
  14.  }

More info... http://dbscript.net/cookie




Tags:

todo:  support for clients with cookies-disabled
version:  0.1.2
access:  public
author:  Brian Hendrickson <brian@dbscript.net>


[ Top ]


Class Variables

$cookiename =  'auth'

[line 56]


Type:   mixed


[ Top ]

$created =

[line 51]


Type:   mixed


[ Top ]

$expiration =  '1800'

[line 58]


Type:   mixed


[ Top ]

$glue =  '|'

[line 60]


Type:   mixed


[ Top ]

$key =  'foobar'

[line 55]


Type:   mixed


[ Top ]

$mode =  'cfb'

[line 54]


Type:   mixed


[ Top ]

$myversion =  '1'

[line 57]


Type:   mixed


[ Top ]

$userid =

[line 52]


Type:   mixed


[ Top ]

$validated =  false

[line 61]


Type:   mixed


[ Top ]

$version =

[line 53]


Type:   mixed


[ Top ]

$warning =  '300'

[line 59]


Type:   mixed


[ Top ]



Class Methods


constructor Cookie [line 63]

Cookie Cookie( )



[ Top ]

method get_rnd_iv [line 71]

void get_rnd_iv( $iv_len)



Parameters:

   $iv_len  

[ Top ]

method logout [line 139]

void logout( )



[ Top ]

method md5_decrypt [line 93]

void md5_decrypt( $enc_text, $password, [ $iv_len = 16])



Parameters:

   $enc_text  
   $password  
   $iv_len  

[ Top ]

method md5_encrypt [line 78]

void md5_encrypt( $plain_text, $password, [ $iv_len = 16])



Parameters:

   $plain_text  
   $password  
   $iv_len  

[ Top ]

method set [line 135]

void set( )



[ Top ]

method validate [line 107]

void validate( )



[ Top ]

method _decrypt [line 142]

void _decrypt( $crypttext)



Parameters:

   $crypttext  

[ Top ]

method _encrypt [line 146]

void _encrypt( $plaintext)



Parameters:

   $plaintext  

[ Top ]

method _package [line 130]

void _package( )



[ Top ]

method _reissue [line 150]

void _reissue( )



[ Top ]

method _unpackage [line 124]

void _unpackage( $cookie)



Parameters:

   $cookie  

[ Top ]


Documentation generated on Mon, 19 Feb 2007 10:24:43 -0800 by phpDocumentor 1.3.1