Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maintaining state information across applications and pageloads

Status
Not open for further replies.

afroblanca

Programmer
Jul 15, 2005
67
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top