function drupal_session_id

Session ids are hashed by default before being stored in the database.

This should only be done if any existing sessions have been updated, as reflected by the hash_session_ids variable.

Parameters

$id: A session id.

Return value

The session id which may have been hashed.

3 calls to drupal_session_id()
drupal_session_regenerate in includes/session.inc
Called when an anonymous user becomes authenticated or vice-versa.
SessionHttpsTestCase::assertSessionIds in modules/simpletest/tests/session.test
Test that there exists a session with two specific session IDs.
_drupal_session_write in includes/session.inc
Writes an entire session to the database (internal use only).

File

includes/session.inc, line 617

Code

function drupal_session_id($id) {
    if (variable_get('hashed_session_ids_supported', FALSE) && !variable_get('do_not_hash_session_ids', FALSE)) {
        $id = drupal_hash_base64($id);
    }
    return $id;
}

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