Just so you know you have a syntax error in your switch command:
switch ($condition);{
case 1 :
// open sub1.php
break;
case 2:
// open sub1.php
.......
The initial switch($command) should not have a semicolon after it. This is corrrect:
switch ($condition){
case 1 :
// open sub1.php
break;
case 2:
// open sub1.php
.......
And going with everyone else's advice - either redesign the script, or use redirects, or have the standard "session" functions you're using in an include and include them in every subn.php page.