How do we start a php session?

Options
- Using session_start()
- Using session_register()
- Using the variable $_SESSION
- Using session_set()


CORRECT ANSWER : Using session_start()

Discussion Board
Start a PHP session

Answer : session_start()

session_start() creates a session or resumes the current one based on a session identifier. It must be the first thing sent to the browser, or it won't work properly.
It is the default syntax to start a PHP session.

Syntax :
session_start()

IamJay 02-9-2015 11:14 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement