Trying a simple test of passing $_SESSION variables between two php pages. I don't see any data on the second page and the session id that is printed out is not the same as the first page session id of the same SESSIONSAMPLE name, which I think is the problem. When I refresh either page the session id constantly changes as well which doesn't seem right either. I have session.auto_st art set to 0 (off). Any help would be greatly appreciated. Here are the two scripts:
[code=php]<?php
session_name('S ESSIONSAMPLE');
session_start() ;
$_SESSION['user_name'] = 'chippy';
$_SESSION['full_name'] = 'Chippy the Chipmunk';
$_SESSION['last_visit'] = '2 weeks ago';
$_SESSION['favourites'] = 'Books';
print_r($_SESSI ON);
echo "<br/>\n";
print_r(session _id());
echo "<br/>\n";
print_r(session _name());
echo "<br/>\n";
print_r(session _get_cookie_par ams());
echo "<br/>\n";
?>
<br/>
<br/>
<a href="session2. php">Click Here for Next Page</a>
<br/>
session2.php
<?php
session_name('S ESSIONSAMPLE');
session_start() ;
//
// show the session data as we have them thus far.
//
print_r($_SESSI ON);
echo "<br/>\n";
print_r(session _id());
echo "<br/>\n";
print_r(session _name());
echo "<br/>\n";
print_r(session _get_cookie_par ams());
echo "<br/>\n";
?>[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
[code=php]<?php
session_name('S ESSIONSAMPLE');
session_start() ;
$_SESSION['user_name'] = 'chippy';
$_SESSION['full_name'] = 'Chippy the Chipmunk';
$_SESSION['last_visit'] = '2 weeks ago';
$_SESSION['favourites'] = 'Books';
print_r($_SESSI ON);
echo "<br/>\n";
print_r(session _id());
echo "<br/>\n";
print_r(session _name());
echo "<br/>\n";
print_r(session _get_cookie_par ams());
echo "<br/>\n";
?>
<br/>
<br/>
<a href="session2. php">Click Here for Next Page</a>
<br/>
session2.php
<?php
session_name('S ESSIONSAMPLE');
session_start() ;
//
// show the session data as we have them thus far.
//
print_r($_SESSI ON);
echo "<br/>\n";
print_r(session _id());
echo "<br/>\n";
print_r(session _name());
echo "<br/>\n";
print_r(session _get_cookie_par ams());
echo "<br/>\n";
?>[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Comment