![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| avb Sat May 19 17:26:25 2007 UTC Modified files: /pear/HTTP_Client/Client CookieManager.php Log: Added a parameter toggling session cookies serialization (they were previously always deleted) http://cvs.php.net/viewvc.cgi/pear/H...&diff_format=u Index: pear/HTTP_Client/Client/CookieManager.php diff -u pear/HTTP_Client/Client/CookieManager.php:1.6 pear/HTTP_Client/Client/CookieManager.php:1.7 --- pear/HTTP_Client/Client/CookieManager.php:1.6 Sat May 19 14:57:31 2007 +++ pear/HTTP_Client/Client/CookieManager.php Sat May 19 17:26:25 2007 @@ -39,7 +39,7 @@ * @package HTTP_Client * @author Alexey Borzov <avb@php.net> * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: CookieManager.php,v 1.6 2007/05/19 14:57:31 avb Exp $ + * @version CVS: $Id: CookieManager.php,v 1.7 2007/05/19 17:26:25 avb Exp $ * @link http://pear.php.net/package/HTTP_Client */ @@ -60,15 +60,35 @@ */ var $_cookies = array(); + /** + * Whether session cookies should be serialized on object serialization + * @var boolean + * @access private + */ + var $_serializeSessionCookies = false; + /** * Constructor * - * @access public + * @param boolean Whether session cookies should be serialized + * @access public + * @see serializeSessionCookies() + */ + function HTTP_Client_CookieManager($serializeSession = false) + { + $this->serializeSessionCookies($serializeSession); + } + + /** + * Sets whether session cookies should be serialized when serializing object + * + * @param boolean + * @access public */ - function HTTP_Client_CookieManager() + function serializeSessionCookies($serialize) { - // abstract + $this->_serializeSessionCookies = (bool)$serialize; } @@ -207,16 +227,20 @@ /** - * Magic serialization function, removes session cookies + * Magic serialization function + * + * Removes session cookies if $_serializeSessionCookies is false (default) */ function __sleep() { - foreach ($this->_cookies as $hash => $cookie) { - if (empty($cookie['expires'])) { - unset($this->_cookies[$hash]); + if (!$this->_serializeSessionCookies) { + foreach ($this->_cookies as $hash => $cookie) { + if (empty($cookie['expires'])) { + unset($this->_cookies[$hash]); + } } } - return array('_cookies'); + return array('_cookies', '_serializeSessionCookies'); } @@ -226,7 +250,7 @@ function __wakeup() { foreach ($this->_cookies as $hash => $cookie) { - if (strtotime($cookie['expires']) < time()) { + if (!empty($cookie['expires']) && strtotime($cookie['expires']) < time()) { unset($this->_cookies[$hash]); } } | |||
| Featured Websites | ||||
|
![]() |
| Tags: cookiemanagerphp, cvs, http_clientclient, pear |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR/PackageFile/Generator v2.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR Installer.php /PEAR/PackageFile v1.php /PEAR/PackageFile/v2 Validator.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR Downloader.php /PEAR/Downloader Package.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear /PHP_CodeSniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting FileCommentSniff.php | Greg Sherwood | Pear | 0 | 05-20-2007 7:41 PM |
| [ANNOUNCEMENT] HTTP_Client-1.1.1 (stable) Released. | PEAR Announce | Pear | 0 | 05-20-2007 6:34 PM |
| Featured Websites | ||||
|