you could throw the master page name into the session, but sessions are unreliable. i'd recommend throwing it in a db instead.
once you're in the page, you can change/set the master page by accessing page.masterpagefile. it's a string; just pass the .master name in.