Finally understand how to change url and set session variable depending on it