title: Static fields vs Session variables
body: <p>So far I've been using Session to pass some variables from one page to another. For instance user role. When a user logs in to the web application the role id of the user is kept in Session and that role is checked at different parts of the application. I've recently started thinking why not use static members instead. I can store the same information in a static field and easily access it anywhere in my application (well anywhere the namespace in which that static field resides is included.) I know that using Session variables comes handy sometimes,  such that:</p>
  
  <ol>
  <li>Any kind of data can be stored in Session. It then must be casted however.But static fields accept data with the correct datatype only.</li>
  <li>Session variables will expire after a certain time which is the behavior we need in many cases.</li>
  </ol>
  
  <p>Apart from the above, are there any other reasons why I should not use static fields to store data and have it available everywhere?</p>