That seems like a colossal waste of time when you could just set a subkey of your session array equal to your entire $POST or $GET array like this:
$_SESSION['getvars']=$_GET;
$_SESSION['postvars']=$_POST;
//Now $_SESSION['getvars'] holds all your submitted form data
//and you can access them just like any old sub-array:
echo $_SESSION['getvars']['getvar1'];
//or you could loop through them and do something:
foreach($_SESSION['getvars'] as $value){
echo $value;
}
Just remember, all these SUPERGLOBALs are ARRAYS and they behave just like any other PHP array.