0

session

How to connect session_start? I tried but it fails

21st Sep 2019, 12:35 PM
Juma Mahamoud
Juma Mahamoud - avatar
1 Respuesta
0
session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie. Syntax: session_start ([ array $options = array() ] ) : bool Simple example: <?php // page1.php session_start(); echo 'Welcome to page #1'; $_SESSION['favcolor'] = 'green'; $_SESSION['animal'] = 'cat'; $_SESSION['time'] = time(); // Works if session cookie was accepted echo '<br /><a href="page2.php">page 2</a>'; // Or maybe pass along the session id, if needed echo '<br /><a href="page2.php?' . SID . '">page 2</a>'; ?> Reference from: https://www.php.net/manual/en/function.session-start.php
21st Sep 2019, 1:00 PM
Chirag Kumar
Chirag Kumar - avatar