What I meant is this:
The changes you're making (or at least, attempting to make) will only succeed if the browser makes a new request for the form page (at which point the PHP page sending the form will see the session values and output them in the appropriate place in the HTML).
However, if by pressing the "Back" button your browser is simply loading a cached version of the page it thinks it already downloaded, your new PHP code will never get executed since the browser never re-requested the form page. After all, the browser is trying to do you a favor by using its cache to load recently visited pages from disk/memory rather than using your bandwidth to re-download it all over again. Hence why I asked if you tried refreshing the page to eliminate the cache effect.
If that still didn't work, then there must be something wrong with how you're using the session. For example, I have two critiques for Undrium's example code:
This:
if(!isset($_SESSION)){
//Start session
session_start();
}
should simply be this:
session_start();
All instances of this:
<?
should be this:
<?php
(in other words, never use the '<?' or '<?=' short tags).
Two more helpful debugging tips when working with sessions would be:
Output the value of [man]session_id/man somewhere on each page that uses the session. Verify that this value never changes; if it does, that means your unique session ID isn't getting propagated from one page request to another (thus PHP is creating a new session rather than re-opening the existing one).
Use [man]print_r/man or [man]var_dump/man on the entire $_SESSION array to view its contents (and/or track changes from one page request to another).