Replace back button function with session var