Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework, Sessions, and HttpOnly

I want to make my session cookie HttpOnly. Based on this article, I added this to my application.ini:

resources.session.cookie_httponly = true

Unfortunately, when I look at the session cookie in Firecookie, it is not marked as HttpOnly as I have specified. What step am I missing?

alt text

like image 817
Sonny Avatar asked Dec 16 '10 14:12

Sonny


3 Answers

Add this to your application.ini file.

phpSettings.session.cookie_httponly = true
like image 56
arturgrigor Avatar answered Nov 07 '22 05:11

arturgrigor


Try at bootstrap to do Zend_Session::setOptions(array('cookie_httponly' => true)); ( somewhere before the session is first initialized ) tough it should work with the app.ini file too .

like image 36
Poelinca Dorin Avatar answered Nov 07 '22 07:11

Poelinca Dorin


For this to be 100% safe.

The server should not allow the option http trace. The http option trace reports the session id. If a attacker can inject a java applet, flash or javascript with ajax the attacker can also steal cookies even with the httponly flag set...

like image 1
Raymond Nijland Avatar answered Nov 07 '22 05:11

Raymond Nijland