Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 10th, 2006, 08:06 PM
Registered User
Join Date: Aug 2005
Location: , , .
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.
  #2 (permalink)  
Old January 13th, 2006, 05:21 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 06:00 PM.

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