session_id_basic.phpt 816 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Test session_id() function : basic functionality
  3. --EXTENSIONS--
  4. session
  5. --SKIPIF--
  6. <?php include('skipif.inc'); ?>
  7. --FILE--
  8. <?php
  9. ob_start();
  10. echo "*** Testing session_id() : basic functionality ***\n";
  11. var_dump(session_id());
  12. var_dump(session_id("test"));
  13. var_dump(session_id());
  14. var_dump(session_id("1234567890"));
  15. var_dump(session_id());
  16. // Turn off strice mode, since it does not allow uninitialized session ID
  17. ini_set('session.use_strict_mode',false);
  18. var_dump(session_start());
  19. var_dump(session_id());
  20. var_dump(session_destroy());
  21. var_dump(session_id());
  22. echo "Done";
  23. ob_end_flush();
  24. ?>
  25. --EXPECT--
  26. *** Testing session_id() : basic functionality ***
  27. string(0) ""
  28. string(0) ""
  29. string(4) "test"
  30. string(4) "test"
  31. string(10) "1234567890"
  32. bool(true)
  33. string(10) "1234567890"
  34. bool(true)
  35. string(0) ""
  36. Done