Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.