php generates new session id for each reload or request?

Nizzy

New member
I have a new server and just realized that php generates new session id for each reload or request.

Upfront:
-- I haven't used session_regenerate_id();
-- I don't have Zone Alarm or other firewall apps installed
-- session.use_cookies = 1 is already set
-- /tmp dir is writable
-- browser accepts all cookies

Issue: I made a simple session test. A page where I display session vars. However, PHP generates a new session id for each reload...You can see this from browser's cookie and /tmp.

Simply, it does not keep the current session id during visits.

Can anyone help me? I really need an urgent help. Appreciated.

Nizzy
Matt, thanks, but I am not destroying the session. If I reload, then php creates another session id.

<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
FYI:
This is a server and PHP configuration issue.
 
Back
Top