tries to deal with sessions. mostly accounts for unset variables