user_session_test.module 580 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @file
  4. * Dummy module implementing a page callback to create an anon session.
  5. */
  6. /**
  7. * Implements hook_menu().
  8. */
  9. function user_session_test_menu() {
  10. $items = array();
  11. $items['user_session_test_anon_session'] = array(
  12. 'page callback' => 'user_session_test_anon_session',
  13. 'access callback' => TRUE,
  14. );
  15. return $items;
  16. }
  17. /**
  18. * Page callback.
  19. *
  20. * Creates an anonymous user session.
  21. */
  22. function user_session_test_anon_session() {
  23. $data = 'This dummy data will be stored in a user session.';
  24. $_SESSION[__FUNCTION__] = $data;
  25. return $data;
  26. }