Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regarding Profile and session in asp.net

Tags:

asp.net

what is the basic difference between session and profile. whatever we store in session that data can be access from any page in asp.net and whatever we store in profile that data also can be access from any page in asp.net from profile. i often store user specific data in session. so i just want to know in what kind of situation we store data in profile instead of session. another things i want to know whose performance is good session or profile. please discuss. thanks

like image 503
Thomas Avatar asked Feb 23 '11 08:02

Thomas


1 Answers

Profile:

1- Profile object is scoped to a particular user: Each user of a web application automatically has his own profile.

2- Profile object is persistant: When you modify the stat os the profile object, the modifications are saved between visits to the website

3- Profile object uses the provider model to store information: By default, the contents of a user profile are automatically saved to a Microsoft SQL Server Express database located in App_Data of your web application.

4- Profile object is strongly typed: Using strongly typed properties has several advantages. For example, you get full Microsoft IntelliSense when using the Profile object in VS.NET 2005 or Visual Web Developer

Session:

1- Session object is scoped to a particular user: Each user of a web application automatically has his own Session state.

2- Session object is non-persistant: When you add an item to the Session object, the items disappear after you leave the Web site.

3- Session object uses three different ways to be stored: 3.1: In Process - default 3.2: State Server (Out of Process) 3.3: SQL Server

4- Session object is not strongly typed:

source: Profile VS Session

like image 113
Davide Piras Avatar answered Sep 27 '22 23:09

Davide Piras