<?php
session_start();
if(isset($_SESSION['views'])) {
$_SESSION['views'] = $_SESSION['views']+ 1; }
else {
$_SESSION['views'] = 1; }
echo "views = ". $_SESSION['views'];
?>
I am trying to set the session and increment the session on every refresh. But its always returning "1" for $_SESSION['views']
. What is wrong with this code?