MarkItUp.Web.Utilities.Personalization
One of the projects that I'm currently working on requires a fair amount of "personalization" data to be stored in Cookies on the client so, this afternoon I decided to create a wrapper around the HttpCookies collection class to abstract some of the tasks such as Add/Update/Delete of user information and setting expiry dates on certain types of information.
Here's a link to the .chm and the compiled assembly for anyone that would like to play around with it ( I can also make the code available for anybody that would like it).
Get the sample
Here's a short blurb about the intent of the assembly.
MarkItUp.Web.Utilities.Personalization
The Personalization class is designed to simplify the task of storing small amounts of data about user preferences against a given "Store".
An application may have more than one store such as an "Application" store, a "Shopping" store, a "FavouriteLinks" store or a "UserPreferences" store. The store itself can have sub-keys. For example the "UserPreferences" store may have a "DatabaseServerName" item and a "ThemeName" item while the "Application" store might have a "NumberOfItemsPerPage" item and a "PreferredName" item.
All data is stored in client-side cookies.
This example creates an instance of the Shopping store sets or removes a user defined item based on the value entered into the itemValueTextBox TextBox:
string itemName = itemNameTextBox.Text ;
string itemValue = itemValueTextBox.Text ;
Personalization p = new Personalization( "Shopping" ) ;
if( itemValue.Trim().Length == 0 )
{
p.Remove( itemName ) ;
}else{
p.SetValue( itemName, itemValue ) ;
}