Return to Snippet

Revision: 25669
at April 5, 2010 13:47 by asterfr


Initial Code
<?php
/**
 * This script helps you to test session persistence for your HTTP API
 * 
 * launch this.php?set=valuuue to set the session value stored to value
 * launch this.php to retrieve the value
 */

session_start();

if (isset($_GET['set'])) {
	$_SESSION['value'] = $_GET['set'];
	echo 'value set to : '.$_SESSION['value'];
} else {
	if (!isset($_SESSION['value'])) {
		echo 'no value stored';
	} else {
		echo 'session contains : '.$_SESSION['value'];
	}
}
?>

Initial URL


Initial Description
This script helps you to test session persistence for your HTTP API.

Launch this.php?set=valuuue to set the session value stored to value.
Launch this.php to retrieve the value.

Initial Title
Simple http session

Initial Tags
php

Initial Language
PHP