session_test.php 333 B

123456789101112131415161718
  1. <?php
  2. session_name('_SESS');
  3. session_start();
  4. if (isset($_GET['login'])) {
  5. session_regenerate_id();
  6. }
  7. ?>
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <title>Session Test</title>
  12. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  13. </head>
  14. <body>
  15. <div id="session-id"><?php echo session_id() ?></div>
  16. </body>
  17. </html>