test.php 358 B

1234567891011121314151617
  1. <?php
  2. // page1.php
  3. session_start();
  4. echo 'Welcome to page #1';
  5. $_SESSION['favcolor'] = 'green';
  6. $_SESSION['animal'] = 'cat';
  7. $_SESSION['time'] = time();
  8. // Works if session cookie was accepted
  9. echo '<br /><a href="page2.php">page 2</a>';
  10. // Or maybe pass along the session id, if needed
  11. echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
  12. ?>