← All docs

session_id()

Reads or sets the current session id.

session_id()

function session_id(?string $id = null): mixed

Reads or sets the current session id.

Parameters:

  • $id (?string), default null, optional

Returns: mixed

Availability

  • Compiled (AOT): supported through an injected elephc-PHP prelude.
  • eval() (magician interpreter): not available inside eval’d code.

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how session_id is implemented in the compiler, see the internals page.