Skip to content

Stdlib: session_* builtins with file-backed $_SESSION (VM) - #1294

Merged
PurHur merged 2 commits into
masterfrom
agent/stdlib-session
May 24, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/stdlib-session

Conversation

@PurHur

@PurHur PurHur commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement session_start(), session_id(), session_name(), session_destroy(), session_write_close(), and session_regenerate_id() for VM mode
  • Add VmSession file driver: serialized $_SESSION under PHP_COMPILER_SESSION_DIR or sys_get_temp_dir()/phpc_sessions
  • Emit Set-Cookie via existing ResponseContext / SetcookieLine; resume from $_COOKIE on next request
  • Fix side-effect builtins to run when called as statements (FUNCCALL_EXEC_NORETURN without returnVar)
  • JIT/AOT deferred (VM-only) per stdlib wave 2 policy

Closes #64
Closes #1182
Closes #1183
Closes #1184
Closes #1185
Closes #1186

Test plan

  • SessionBuiltinTest — two-request persistence, destroy, regenerate id
  • test/compliance/cases/stdlib/session*.phpt — VM PHPT smoke
  • php script/capability-matrix.php --check
  • ./script/ci-fast.sh --filter SessionBuiltinTest (Docker tar harness)

Made with Cursor

PurHur and others added 2 commits May 24, 2026 00:30
Add session_start, session_id, session_name, session_destroy,
session_write_close, and session_regenerate_id for North Star web/self-host
stdlib coverage. Sessions persist via serialized $_SESSION files under
PHP_COMPILER_SESSION_DIR or sys temp; JIT deferred as VM-only.

Closes #64. Closes #1182. Closes #1183. Closes #1184. Closes #1185. Closes #1186.

Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate capability matrix and stdlib JIT audit after merge with
preg_replace_callback on master.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit b1a4ac9 into master May 24, 2026
@PurHur
PurHur deleted the agent/stdlib-session branch May 24, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant