Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2006, 08:06 PM
Registered User
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Maintaining state information across applications

Question #1 : I'm trying to maintain a user's state information (name, birthdate, zipcode, etc.) across applications and pageloads.

What I've been doing thus far:
1) When a user logs in, generate a sessionId.
2) Store the sessionId in a database table along with the user's userId
3) Set a cookie with the user's sessionId
4) When an application loads, read the cookie, get the userId, and load the user's state information
5) Store the user's state information in ViewState

Steps 4 and 5 must be repeated every time a user loads a new application. This causes a lot of DB accessing and does not maintain the user's state across applications. It also slows down pageloads due to high ViewState content. Is there a better way to do this? How do the "big sites" accomplish what I'm trying to do?

Question #2 : I'm trying to share site configuration data (siteName, siteId, root url, etc.) between different applications on a given website. What is the best way to do this that doesn't involve files, database tables, or querystring arguments?

I've considered using cookies to solve both Questions #1 and #2, but this seems risky and unreliable.

Thanks for your help.
 
Old January 13th, 2006, 05:21 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well, the ways you don't want to use are how the "big sites do it". They probably have their own state management systems that involve databases. When you start to cross between different applications, you'll need some form of persistant medium to store the information with unique identifiers to access it.

Cookies would be reliable but like you say, could be risky depending on the content as they are transmitted as plain text over HTTP.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintaining state in a TreeView Nick710 ASP.NET 2.0 Professional 3 December 23rd, 2005 01:58 PM
maintaining session state in C# grs General .NET 0 January 13th, 2005 03:46 AM
Maintaining State in Tables MikeSchnell ASP.NET 1.0 and 1.1 Basics 1 March 25th, 2004 01:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.