Home Tutorial Php Examples Starting the session.

 
 

Starting the session.
Posted on: July 30, 2009 at 12:00 AM
Advertisement
This is the example of starting the session in PHP.

session_start()

session_start function creates a session or resumes the current one based on the  current session id that is being passed via a request like GET, POST, or a cookie. For using named session, first you will have to call session_name() before calling session_start(). The session_start function returns TRUE if the session starts successfully otherwise it returns FALSE.

Syntax

session_start();

Example:

<?php
session_start();
echo "your session ID is ".session_id();
?>

In the output, you will get your session ID. 

Advertisement

Related Tags for Starting the session.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 30, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com