I used a global variable in my app for passing information before. But I got a problem and thanks everyone here suggested me to store those data in session with database.
Models are an interface to the database. They can be used without a session (e.g. from IRB). It would be a violation of MVC to allow the models to talk to the session. Can you expand your question with a bit more info about what you're trying to do? There is most probably a better way to do it.