[Hastymail-cvs] SF.net SVN: hastymail:[2128] trunk/hastymail2/lib/utility_classes.php
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2012-11-29 18:49:33
|
Revision: 2128 http://hastymail.svn.sourceforge.net/hastymail/?rev=2128&view=rev Author: sailfrog Date: 2012-11-29 18:49:27 +0000 (Thu, 29 Nov 2012) Log Message: ----------- httponly cookie flag is only supported in php version 5.2+ Modified Paths: -------------- trunk/hastymail2/lib/utility_classes.php Modified: trunk/hastymail2/lib/utility_classes.php =================================================================== --- trunk/hastymail2/lib/utility_classes.php 2012-11-28 14:40:45 UTC (rev 2127) +++ trunk/hastymail2/lib/utility_classes.php 2012-11-29 18:49:27 UTC (rev 2128) @@ -830,10 +830,13 @@ $this->random_session_id = false; } function set_ini_vals($use_cookies, $path, $secure) { + global $phpversion; if ($use_cookies) { @ini_set('session.use_cookies', 1); @ini_set('session.use_trans_sid', 0); - @ini_set('session.cookie_httponly', 1); + if ($phpversion >= 5.2) { + @ini_set('session.cookie_httponly', 1); + } @ini_set('session.cookie_path', $path); @ini_set('session.cookie_secure', $secure); session_name($this->cookie_name); @@ -847,6 +850,7 @@ function start_session() { global $user; global $conf; + global $phpversion; @ini_set('arg_separator.output', '&'); $this->set_ini_vals($user->use_cookies, $user->cookie_path, $user->cookie_secure); @session_start(); @@ -858,7 +862,12 @@ $_SESSION['browser_fingerprint'] = build_browser_fingerprint(); if ($user->use_cookies) { $_SESSION['hm_int_id'] = build_internal_id(); - setcookie('hm_int_id', $_SESSION['hm_int_id'], 0, $user->cookie_path, '', $user->cookie_secure, true); + if ($phpversion >= 5.2) { + setcookie('hm_int_id', $_SESSION['hm_int_id'], 0, $user->cookie_path, '', $user->cookie_secure, true); + } + else { + setcookie('hm_int_id', $_SESSION['hm_int_id'], 0, $user->cookie_path, '', $user->cookie_secure); + } } } function check_basic_auth() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |