Home » HTTP » HTTP_Client » Bug #9142
Cookies deleted on serialization
Details
| Request #9142 | Cookies deleted on serialization |
|---|---|
| Submitted | 2006-10-23 18:51 UTC |
| From | yap at yapsoft dot it |
| Status | Duplicate |
| Package | HTTP_Client |
| PHP Version | 4.3.10 |
| OS | Linux 2.6 |
| Roadmaps | (Not assigned) |
Comments
[2006-10-23 18:51 UTC] yap at yapsoft dot it
Description:
------------
The member __sleep of the class HTTP_Client_CookieManager deletes cookies without expire time.
If you use HTTP_Client to connect to a password protected website (php protection) you have to reauthenticate everytime and you lose the benefit of persistent HTTP_Client.
[2007-02-05 05:39 UTC] arailean at squiz dot net
See Bug #8778
To find out that this is not considered a bug by the maintainer.
http://pear.php.net/bugs/bug.php?id=8778
[2007-02-27 03:56 UTC] bogus at something dot com
Here's what I did as a workaround:
Instead of serializing the object just serialize the vars:
$vars = get_object_vars($cookieman);
$serialized = serialize($vars);
To load them back into the object do:
$cookieman = new HTTP_Client_CookieManager();
$vars = unserialize($serialized);
foreach($vars as $var_k => $var_v){
$cookieman->{$var_k}=$var_v;
}
I'm new to php(and I don't really want to learn it) so this might(read won't) be the best solution ;)
HTH
Michael Walloch