Yii Framework Forum: HttpOnly in addCookie - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

HttpOnly in addCookie Rate Topic: -----

#1 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 29 October 2008 - 04:03 PM

Please read this

:)
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,879
  • Joined: 04-October 08
  • Location:DC, USA

Posted 29 October 2008 - 04:18 PM

Done.
0

#3 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 29 October 2008 - 04:44 PM

Thanks Qiang, but, are you considering the fact that the httponly flag appeared until PHP 5.2? I guess a PHP version check is necessary or PHP 5.1 will throw an error (please see my post here and please correct me if I'm wrong).
0

#4 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 29 October 2008 - 04:46 PM

Also, there's another [tt]addCookie[/tt] in [tt]yiilite.php[/tt], line 2069...
0

#5 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,879
  • Joined: 04-October 08
  • Location:DC, USA

Posted 29 October 2008 - 04:52 PM

passing an extra parameter to a function won't cause problem. That's why I skipped the php version check.


0

#6 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 29 October 2008 - 05:08 PM

Quote

passing an extra parameter to a function won't cause problem. That's why I skipped the php version check.


hmmmm...

<?php
$name = 'x';
$value = 'y';
$expire = time();
$path = '/';
$domain = 'test.com';
$secure = false;
$httponly = true;
$something = 'xyz';
setcookie($name,$value,$expire,$path,$domain,$secure,$httponly,$something);
?>


shows a warning:

[tt]Warning: setcookie() expects at most 7 parameters, 8 given in /path/to/test.php on line 3[/tt]

with my PHP 5.2.6 ([tt]error_reporting = E_ALL & ~E_NOTICE[/tt]). I don't know if PHP 5.1 just ignores an extra parameter without warning, can someone confirm?
0

#7 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,879
  • Joined: 04-October 08
  • Location:DC, USA

Posted 30 October 2008 - 06:30 AM

Ok, i fixed this. Thanks!
0

#8 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 30 October 2008 - 04:19 PM

Hmm, I can confirm that there's a bug in addCookie (my mistake)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users