Function __global->create_session

Definitions

sources/users_inactive_occasionals.php

  • Set up a new session / Restore an existing one that was lost.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id MEMBER No No required parameter N/A N/A Logged in member
$session_confirmed BINARY No No 0 N/A N/A Whether the session should be considered confirmed
$invisible boolean No No False N/A N/A Whether the session should be invisible
$create_cookie boolean No No True N/A N/A Whether to create the cookie for the session
$ip_address ?IP No No Null N/A N/A IP address for session (null: current user's IP address)
$allow_shy_session boolean No No True N/A N/A Whether to allow shy sessions on cached guests; should be false when running from minikernel

Returns

  • New session ID
  • Type: ID_TEXT
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Set up a new session / Restore an existing one that was lost.
 *
 * @param  MEMBER $member_id Logged in member
 * @param  BINARY $session_confirmed Whether the session should be considered confirmed
 * @param  boolean $invisible Whether the session should be invisible
 * @param  boolean $create_cookie Whether to create the cookie for the session
 * @param  ?IP $ip_address IP address for session (null: current user's IP address)
 * @param  boolean $allow_shy_session Whether to allow shy sessions on cached guests; should be false when running from minikernel
 * @return ID_TEXT New session ID
 */

function create_session(int $member_id, int $session_confirmed = 0, bool $invisible = false, bool $create_cookie = true, ?string $ip_address = null, bool $allow_shy_session = true) : string