Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 11-08-2012 09:54:30

htw_simon
Member
From: UK
Registered: 11-20-2007
Posts: 83
Website

Session Cookie Attribute

How do I add the HTTPONLY attribute to the cookie that includes 'sid='?

Thanks,

Simon

Offline

 

#2 11-14-2012 05:07:11

htw_simon
Member
From: UK
Registered: 11-20-2007
Posts: 83
Website

Re: Session Cookie Attribute

For anyone else where this comes up on their PCI compliance edit the file {PRIVATE}>core>CORE_Session>CORE_Session.php and change:

Code:

if ($this->ssl) {

     $domain     = $this->globals('core.cookie_domain_ssl');
     $path       = $this->globals('core.cookie_path_ssl');

} else {

     $domain     = $this->globals('core.cookie_domain_nonssl');
     $path       = $this->globals('core.cookie_path_nonssl');

} // End of if statement.

if (!(preg_match('/\/$/',$path))) {$path .= '/';}

setcookie($name, $value, $expiration, $path, $domain);

to this:

Code:

if ($this->ssl) {

     $domain     = $this->globals('core.cookie_domain_ssl');
     $path       = $this->globals('core.cookie_path_ssl');
     $secure = 1;

} else {

     $domain     = $this->globals('core.cookie_domain_nonssl');
     $path       = $this->globals('core.cookie_path_nonssl');
     $secure = 0;

} // End of if statement.

if (!(preg_match('/\/$/',$path))) {$path .= '/';}

$httponly = 1;

setcookie($name, $value, $expiration, $path, $domain, $secure, $httponly);

Offline

 

Board footer