8
Reply

What is the difference between Application and session variable?

Ravi Patel

Ravi Patel

Jan 25, 2017
2.2k
1

    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…

    Ravi Patel
    January 25, 2017
    4

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

    Naveen Bisht
    February 16, 2017
    1

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

    Manav Pandya
    February 09, 2017
    1

    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 :)

    Amit Swami
    October 14, 2017
    0

    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.

    Ramesh Palanivel
    September 21, 2017
    0

    Application is global while session not

    Mukesh Kumar
    September 10, 2017
    0

    Application is global while session not

    Mukesh Kumar
    September 10, 2017
    0

    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.

    sushil kumar
    July 14, 2017
    0