473,626 Members | 3,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the difference between session object and application object?

22 New Member
What is the difference between session object and application object?
May 6 '19 #1
3 7880
HelenMkt
7 New Member
Session variables are used to store user specific information where as in application variables we can't store user specific information.

Default lifetime of the session variable is20 mins and based on the requirement we can change it.



Application variables are accessible till the application ends.

sessions allows information to be stored in one page and accessed in another,and it supports any type of object,includin g your own custom data types.



Application state allows you to store global objects that can be accessed by any client.

The coomon thing b/w session and application is both support the same type of objects,retain information on the server, and uses the same dictionary -based syntax.
May 6 '19 #2
AjayGohil
83 New Member
Session object
Session object is used to store state specific information per client basis. It is specific to particular user. Session data persists for the duration of user session you can store session's data on web server in different ways. Session state can be configured using the <session State> section in the application's web.config file.
Application object
Application object is used to store data which is visible across entire application and shared across multiple user sessions. Data which needs to be persisted for entire life of application should be stored in application object.
In classic ASP, application object is used to store connection strings. It's a great place to store data which changes infrequently. We should write to application variable only in application_Ons tart event (global.asax) or application.loc k event to avoid data conflicts. Below code sample gives idea
May 29 '19 #3
Sherin
77 New Member
Application object

The Application object is used to store and access variables from any page, just like the Session object.
The difference is that ALL users share ONE Application object (with Sessions there is ONE Session object for EACH user).

Application object is used to store application specific data into server memory
Application["MyData"]="Gobal value"


Session object

ASP solves this problem by creating a unique cookie for each user.
The cookie is sent to the user's computer and it contains information that identifies the user.
This interface is called the Session object.
The Session object stores information about, or change settings for a user session.

Session object is used to store user specific data into server Memory.
Session["MyData"]="Store this data"
Feb 5 '20 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2458
by: lawrence | last post by:
How dangerous or stupid is it for an object to have a reference to the object which contains it? If I have a class called $controllerForAll which has an arrray of all the objects that exist, what happens if one of those objects, when it is created, takes a reference to the object that contains it? Do bad things happen? class McShow {
9
3116
by: gulu man | last post by:
Hi, What is the substitute for COM objects in .NET? How can I create something similar to com in .net? Is it still possible? Thank you
100
5234
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
6
2238
by: SteveS | last post by:
Hello All. I have an asp.net application with 3 different assemblies. They are like this: 1) Assembly: PublicSite (This contains the website UI) Root namespace: PublicSite 2) Assembly: PublicSite.MyProfile.Business (This contains the business rules) Root namespace: PublicSite
3
1356
by: Berkdan | last post by:
hi all, i want to learn this about session object in asp, when i connect to the site can session object write my ip adress to the text file and when i cut the connection then can it write offline to the same text file? it must write when my dial up connection was cutted. can i use session or is there anyway? if it is possible please write any code.
15
1875
by: SFX | last post by:
If I have a session ID (string) can I somehow obtain the session object associated to that ID (it exist of course) ? I know this sounds wicked but I have a situation in which I have to make a request from the client (IE) but for security reasons I can not access the headers of the current request, so I can not make my new request contain the same session ID cookie. So I was thinking that if I pass the session ID as a parameter which I...
2
1286
by: Steve Peterson | last post by:
Hi I have an application that is designed for multi clients, therefore users must go through a login page. Upon logging in I set some properties in a class, one of which is the user id (integer) retrieved from the SQL db and also the company id that successfully logged in. I then add this this class to a session object which I named "CurrentUserInfo". Since the app relies on retrieving only information for the company of which the...
13
1749
by: | last post by:
Simple question, I think... I'm storing an object in the Session object. In the code behind I read that object: trx = CType(Session("Transaction"), BOCSTransaction) If I change any properties, I have to store it back into the session object to "update" it, right? Or will the changes to my object automatically be saved back into the session object? Thanks, Jerry
2
3992
by: Ryan Liu | last post by:
In C#, what's is the difference between object vs Object, exception vs Exception? Thanks, ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. Ryan Liu Shanghai Fengpu Software Co. Ltd
5
1681
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I'm aware of the differences between string and String, but wondered what the differences were between object and Object? -- Regards, Phillip Johnson (MCPD Enterprise Developer) www.4projects.com
0
8262
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8701
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6122
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.