Quick Answer
session_start() must be called at the top of every page using sessions, before any output. It reads the session ID from the cookie, loads saved session data, and makes the session array available. Without it the session array does not exist. After starting a session you can store and read user data across multiple page requests.
Answer
session_start() begins or resumes a session and must be called before any output is sent.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.