Ravi Patel
What is the difference between Application and session variable?
By Ravi Patel in .NET on Jan 25 2017
  • Ravi Patel
    Jan, 2017 25

    Application variables are the variables which remain common for the whole application for all the users… Their value can be used across the whole application by any user… And they die only when the application stops or probably when they are killed forcibly… The ideal example for these kind of variables are site counter… 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..where asSession 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 each user will have a copy… 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 Prabha " on every page of your site till Prabha logs off… So in session start you set a variable to "Welcome Meetu Choudhary" and kill it on end of session…

    • 4
  • Naveen Bisht
    Feb, 2017 16

    Application variable is common for all while session is depends on indivisibly

    • 1
  • Manav Pandya
    Feb, 2017 9

    Session limited to single user interaction whereas application variable resides inside until application will be stopped

    • 1
  • Amit Swami
    Oct, 2017 14

    Application Variable and Session Variable Both Generate From Server ... But Session would have a Different values for every user , while application variable have same value for every user ...application variable creates only one memory for one variable and for all user . while session creates one memory for one variable for one user :)

    • 0
  • Ramesh Palanivel
    Sep, 2017 21

    Application variable will be maintained like global variable. Ex if I create a application session in my project and assign this value 1. Think it's a web application. User 1 is login to my application from his machine and he is clicking the button to increase the application variable value 1.now the application variable value is 2.user 2 is login in our application from another machine and again he is clicking the same button to increase the application session value. Now the value will be 2 to 3.not 1 to 2. But if u maintaining same process in session variable it will be only increase 1 to 2 everyone login and clicking the same button. A real time example for application session variable is to get the count for no of users accessing our application.

    • 0
  • Mukesh Kumar
    Sep, 2017 10

    Application is global while session not

    • 0
  • sushil kumar
    Jul, 2017 14

    Application variable: it is used for entire application which common for all users. It is not for user specific. this variable value will lost when application restarted. Session variable :- this variable is for user specific. the value of the session is available till the user is logged in. when the user logged out session value will be destroyed. every session has unique id.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS