junxiong
(Garry3peace)
March 22, 2011, 10:12am
1
Hello everybody,
is that possible for me setrawcookie in CHttpCookies?
I meet firefox-specific problem. The cookie function encode space character to plus sign (+). But when I use jQuery cookie plugin to retrieve it failed to decoded the plus to spaces. That’s why I think it is better to suse setrawcookie and manually rawurlencod the value…
gusnips
(Gustavo)
March 22, 2011, 10:30am
2
You should open a ticket for it to be fixed
For now, you should extend CCookieCollection to fix it
PS: still working in the layout module … will be ready soon
junxiong
(Garry3peace)
March 22, 2011, 12:21pm
3
You should open a ticket for it to be fixed
For now, you should extend CCookieCollection to fix it
PS: still working in the layout module … will be ready soon
I’ve extended the CCookieCollection, but I don’t know where to change the object’s class in config…
Since "cookie" object it is under "request" object. So where should I point cookie object to my own create class??
Y11
(Y!!)
March 22, 2011, 12:35pm
4
It’s not possible to configure a custom CCookieCollection, so you have to extend CHttpRequest like this:
class MyHttpRequest extends CHttpRequest
{
public function getCookies()
{
if($this->_cookies!==null)
return $this->_cookies;
else
return $this->_cookies=new MyCookieCollection($this);
}
}
Then in config:
'components' => array(
'request' => array(
'class' => 'application.components.MyHttpRequest',
),
),
Can you create a ticket for this issue please?
junxiong
(Garry3peace)
March 22, 2011, 2:06pm
5
It’s not possible to configure a custom CCookieCollection, so you have to extend CHttpRequest like this:
class MyHttpRequest extends CHttpRequest
{
public function getCookies()
{
if($this->_cookies!==null)
return $this->_cookies;
else
return $this->_cookies=new MyCookieCollection($this);
}
}
Then in config:
'components' => array(
'request' => array(
'class' => 'application.components.MyHttpRequest',
),
),
Can you create a ticket for this issue please?
Thanks Y!!
Ok, I’ll create the ticket, on the Yii’s Google project right?