Question: Can anyone give me an Idea about how to manage preferences of every user in asp.net?
for example I have a couple of parameters for all my users and they are correspondingly related to the user 
For instance his birthday or the his salary and I need these specific parameter frequently I did save them in my database and I dont want to fetch them each time I need them
Many thanks

Answer: 
Normally these would be fetched once and stored in the session state. A few warnings:

1) be careful on how much you store in the session. Must be up to a few KB for each user

2) With a server farm, you have to use a sticky session or store the session in SQL or state server

3) Beware of session hijack and make sure important stuff are not stored

4) Nowadays, going to database to get a few records is cheap, do not knock it automatically!
Normally this is stored in session state, but I'd like to say a word regarding separation of concerns. As an example, you might create a repository interface:

```
public interface IProfileDataRepository 
{
    ProfileData GetProfileData(Guid userId);
}

```

Then you use dependency injection to get an object that implements this interface where you need it, so you can retrieve it like this:

```
var profileData = ProfileDataRepository.GetProfileData(currentUserId);

```

You can begin by creating an implementation for this repository which pulls this data out of the database each time it's needed. Then you might change the implementation so that it stores the data either in the session or in an in-memory cache. The data might originate from an XML file, an SSO service, or any other source you can think of. Because you began by defining how you want to ask for the information (the interface), you can change how you actually store it at any time. If the data gets too big to fit comfortably on the session, you can move it somewhere else, whereas if you had begun by littering your code with:

```
var profileData = (ProfileData)Session["ProfileData"];

```

... it would be a huge pain to change everywhere you had done this.