Project

General

Profile

« Previous | Next » 

Revision 581

Added by thorn almost 17 years ago

Unique session-identifier for each website baker installation. fixes #354

View differences:

save.php
23 23

  
24 24
*/
25 25

  
26
// Start a session
26
// Start a session

27 27
if(!defined('SESSION_STARTED')) {
28
	session_name('wb_session_id');
28
	// get random-part for session_name()
29
	list($usec,$sec) = explode(' ',microtime());
30
	srand((float)$sec+((float)$usec*100000));
31
	$session_rand = rand(1000,9999);
32
	session_name("wb_{$session_rand}_session_id");
29 33
	session_start();
30
	define('SESSION_STARTED', true);
31
}
34
	$_SESSION['SESSION_RAND'] = $session_rand;
35
	define('SESSION_STARTED', true);
36
} else {
37
	$session_rand = $_SESSION['SESSION_RAND'];
38
}
32 39

  
33 40
// Function to set error
34 41
function set_error($message) {
......
419 426
	." ('rename_files_on_upload', 'php,asp,phpx,aspx'),"
420 427
	." ('er_level', ''),"
421 428
	." ('default_language', 'EN'),"
422
	." ('app_name', 'wb'),"
429
	." ('app_name', 'wb_$session_rand'),"
423 430
	." ('default_timezone', '$default_timezone'),"
424 431
	." ('default_date_format', 'M d Y'),"
425 432
	." ('default_time_format', 'g:i A'),"

Also available in: Unified diff