]);
}
+ // determine randomized cookie prefix
+ $prefix = 'wsc30_';
+ if (!self::$developerMode) {
+ $cookieNames = array_keys($_COOKIE);
+ while (true) {
+ $prefix = 'wsc_' . substr(sha1(mt_rand()), 0, 6) . '_';
+ $isValid = true;
+ foreach ($cookieNames as $cookieName) {
+ if (strpos($cookieName, $prefix) === 0) {
+ $isValid = false;
+ break;
+ }
+ }
+
+ if ($isValid) {
+ break;
+ }
+ }
+
+ // the options have not been imported yet
+ file_put_contents(WCF_DIR . 'cookiePrefix.txt', $prefix);
+ }
+
// login as admin
- define('COOKIE_PREFIX', 'wsc30_');
+ define('COOKIE_PREFIX', $prefix);
$factory = new ACPSessionFactory();
$factory->load();
*/
define('LAST_UPDATE_TIME', TIME_NOW);
-define('COOKIE_PREFIX', 'wsc30_');
+$prefix = 'wsc30_';
+if (file_exists(WCF_DIR . 'cookiePrefix.txt')) {
+ $prefix = file_get_contents(WCF_DIR . 'cookiePrefix.txt');
+}
+define('COOKIE_PREFIX', $prefix);
+
define('COOKIE_PATH', '');
define('COOKIE_DOMAIN', '');