Store the counter value in sessionStorage