views:

165

answers:

4

I'm working on a .NET 3.5 Web Application and I was wondering what would be good way to persist user specific settings (i.e. user preferences) server-side?

Here are the conditions:

  • It needs to be able to store/retrieve settings based on a User ID
  • I don't want to use SQL Server or any such DB engine
  • I don't want to store it in cookies

Any guidance would be greatly appreciated.

Edit: If it makes any difference, it doesn't have to support a web farm.

+1  A: 

Use the ASP.NET Profile feature for this. See ASP.NET Profile Properties Overview

John Saunders
That was my first thought too but he mentioned no database engine. Can the Profile Manager be configured to use text files instead of database? If so, that is a good solution.
Cody C
My read on Profile Manager was that it required a SqlProfileProvider. This seems to specifically require a DB in which to create the profile tables; which, in turn, would require a DB engine.
CAbbott
See http://msdn.microsoft.com/en-us/library/014bec1k.aspx. The Profile, Membership and Roles features of ASP.NET are all based on a provider architecture, meaning: you can use the same API, while storing the data however you like.
John Saunders
+1 Thanks, this is exactly what I was looking for. It's the custom profile provider that allows me to store it in an XML file.
CAbbott
Sorry I didn't mention it off the bat. It was the basis for my thought about using Profile. I took it for granted that readers would know about the provider-based model of these components.
John Saunders
A: 

Text files (JSON/XML/etc), though security then becomes an associated problem.

mgroves
A: 

Given those parameters, you could just keep track of your own user preferences XML file on the server.

Cody C
This occured to me at first, but the idea of managing the XML via the XMLReader/Writer became rather unappealing. This question seemed to address that: http://stackoverflow.com/questions/317134/
CAbbott
+1  A: 

If you want to persist data, and you don't want to use a database, then you need to save the data to disk (such as XML). If you're looking for something that isn't local to your server, you could use a SaaS solution that would host your data for you, such as Amazon's S3 service. If you do that, the latency of data retrieval will slow your application down, so you'll want to cache the data.

Josh