I have two values k1 and k2 which relate to a session 1 and a session 2. When session one is active k1 is incremented and when session two is active k2 is incremented. The problem is that the new incremented values are associated only with that session so if I try to retrieve them when session = 3 to add them together I cannot, any ideas? The codes below: <?php session_start(); $k1 = 0; $k2 = 0; if(isset($_GET['rst'])) { session_destroy(); header("Location: $_SERVER[PHP_SELF]"); } function add() { if (!isset($_SESSION['init'])) { $_SESSION['init'] = 1; } else { $_SESSION['init']++; } return $_SESSION['init']; } if ($_SESSION['init'] == 1) { $k1 ++; echo $k1; } elseif ($_SESSION['init'] == 2) { $k2 ++; echo $k2; } elseif ($_SESSION['init'] == 3) { $k3 = $k1+$k2; echo $k3; } ?>