I'm not sure how you have got this to work but if you're able to store them in the MasterPage then you should not have a problem with Web Garden or Web Farm environments.
The reason you were having problems with session in this environment is probably because you were probably using InProc Session. This type of Session loads the variables into memory and keeps them there until the Session has expired. The problem with this is that they are loaded into memory on a particular server. If the user's request is sent to another server, then their session is not accessible.
If you still want to use Session you should consider using StateServer Session or SQLServer Session. Both of these types move the Session off of one particular server and into a centralized location so that all servers have access to it.
Check out
Sessions - How To Pass Information Between Web Pages for more information.
-Frinny