Skip to content

Instantly share code, notes, and snippets.

@astorm
Created April 27, 2015 05:08
Embed
What would you like to do?
$value = array_key_exists('test', $_COOKIE) ? $_COOKIE['test'] : 0;
$value++;
setcookie('test', $value);
var_dump($value);
session_start();
$value = array_key_exists('test2', $_SESSION) ? $_SESSION['test2'] : 0;
$value = $value ? $value : 0;
$value++;
$_SESSION['test2'] = $value;
var_dump($value);
session_write_close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment