What is with people coming to get the answers for their homework here.
There should be a law by yahoo! that requires you to donate $1 every time you ask a question that involves your homework.
Look, Do you even understand the the difference between Application Variables, and Session Variables?
Application variables are the variables which remain common for the whole application… Their value can be used across the whole application… And they die only when the application stops or probably when they are killed forcibly… The ideal example for these kinds of variables are site counters… We can find out how many people accessed a particular site since the time it went live via application variables and incrementing the same on ever session start..
Session variables are variables which remain common for the whole application but for one particular user. They also can be used across the whole application… But they die when a particular user session ends or probably when they are killed forcibly… The ideal example for this kind of variable are user id… You might want to show "Welcome User1" on every page of your site till User1 logs off… So in session start you set a variable to "Welcome User1" and kill it on session end…
Now that you understand the difference between Application and Session Variables, you can find them in global.asax.
Let's discuss what we're doing here.
Application Variables are going to be contingent on static content of your site (at least not the user-driven aspects of the site -)
Sessin Variables are going to be contingent on what you (per se) want the user (per se) to see [individually].
For example, When I'm not logged in, I see the text 'Please Log In!'.
Now If I log in, with the username "User 1", then I will see, "Welcome, User 1!".
This occurs, because I've told site to hold the SESSION VARIABLE OF USERNAME.
Once the user logs in, the session variable is modified under the SESSION VARIABLE guidelines, and therefore will dynamically update the field as appropriate.
Now the problem with Session Variables in ASP.net is that they are STATELESS.
This means that if the user navigates to another section of the page, the session variable has ended for that portion. When they go back, it will be reset?
Why, it's an HTTP call that we have to overcome.
You will handle this issue using the "maintaining state" method.
The Maintaining State method is primary run and created under the cookie premise.
Storing Session Variables in Cookies allows for the browser to know that you were an earlier visitor, and to remember the settings that you had before.
NOW DO YOUR HOMEWORK.