user_session_test.module

Dummy module implementing a page callback to create an anon session.

File

modules/user/tests/user_session_test.module

View source
<?php


/**
 * @file
 * Dummy module implementing a page callback to create an anon session.
 */

/**
 * Implements hook_menu().
 */
function user_session_test_menu() {
    $items = array();
    $items['user_session_test_anon_session'] = array(
        'page callback' => 'user_session_test_anon_session',
        'access callback' => TRUE,
    );
    return $items;
}

/**
 * Page callback.
 *
 * Creates an anonymous user session.
 */
function user_session_test_anon_session() {
    $data = 'This dummy data will be stored in a user session.';
    $_SESSION[__FUNCTION__] = $data;
    return $data;
}

Functions

Title Deprecated Summary
user_session_test_anon_session Page callback.
user_session_test_menu Implements hook_menu().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.