session_write_close();
session_id($id);
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
session_start();
session_destroy();
session_write_close();
}
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
session_start();
session_regenerate_id('false');
}
session_id($handle);
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
session_start();
debug('Started session to acquire key: ' . session_id());
global $proto, $profile;
session_name('phpMyID_Server');
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
@session_start();
$profile['authorized'] = (isset($_SESSION['auth_username'])
<?php
+ // FIXME: this should start a secure session if forcessl is enabled
+ // see lib/base.php for an example
session_start();
$_SESSION['timezone'] = $_GET['time'];
-?>
\ No newline at end of file
+?>
date_default_timezone_set('Europe/Berlin');
ini_set('arg_separator.output','&');
- ini_set('session.cookie_httponly','1;');
- session_start();
// calculate the documentroot
OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
// redirect to https site if configured
if( OC_Config::getValue( "forcessl", false )){
+ ini_set("session.cookie_secure", "on");
if(!isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on') {
$url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header("Location: $url");
}
}
+ ini_set('session.cookie_httponly','1;');
+ session_start();
+
// Add the stuff we need always
OC_Util::addScript( "jquery-1.6.4.min" );
OC_Util::addScript( "jquery-ui-1.8.14.custom.min" );
* @param string $username username to be set
*/
public static function setMagicInCookie($username, $token){
- setcookie("oc_username", $username, time()+60*60*24*15);
- setcookie("oc_token", $token, time()+60*60*24*15);
- setcookie("oc_remember_login", true, time()+60*60*24*15);
+ $secure_cookie = OC_Config::getValue("forcessl", false);
+ setcookie("oc_username", $username, time()+60*60*24*15, '', '', $secure_cookie);
+ setcookie("oc_token", $token, time()+60*60*24*15, '', '', $secure_cookie);
+ setcookie("oc_remember_login", true, time()+60*60*24*15, '', '', $secure_cookie);
}
/**