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:

index.php
22 22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23 23

  
24 24
*/
25

  
25

  
26 26
// Start a session
27
if(!defined('SESSION_STARTED')) {
28
	session_name('wb_session_id');
29
	session_start();
27
if(!defined('SESSION_STARTED')) {
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_id");
33
	session_start();
34
	$_SESSION['SESSION_RAND'] = $session_rand;
30 35
	define('SESSION_STARTED', true);
31
}

36
}
32 37

  
33 38
// Check if the page has been reloaded
34 39
if(!isset($_GET['sessions_checked']) OR $_GET['sessions_checked'] != 'true') {

Also available in: Unified diff