Maintaining state information across applications and pageloads

This is a discussion on "Maintaining state information across applications and pageloads" within the ASP.NET Forum section. This forum, and the thread "Maintaining state information across applications and pageloads are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 10th, 2006, 23:10
New Member
Join Date: Nov 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Maintaining state information across applications and pageloads

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.
Reply With Quote

  #2 (permalink)  
Old Jul 18th, 2006, 17:38
Junior Member
Join Date: Jul 2006
Location: Manchester
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Maintaining state information across applications and pageloads

My advice would be to use caching.
Typically I don't use session variables ad what I do is request the user data from the database each time. However if the data has already been requested the method would load it from cache rather than the database.

e.g.

Friend Function LoadMember(MemberId) as MemberObject
Dim obj as Object = Cache("Member" & MemberId.ToString)



End fucntion
Reply With Quote
  #3 (permalink)  
Old Jul 18th, 2006, 17:41
Junior Member
Join Date: Jul 2006
Location: Manchester
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Maintaining state information across applications and pageloads

cant you edit on here? I hit post by mistake! DOH

Friend Function LoadMember(MemberId) as MemberObject
Dim obj as Object = Cache("Member" & MemberId.ToString)
if obj is nothing then
' load from database and add to cache
cache("Member" & MemberId.tostring) = MemberObject1
return MemberObject1
else
return ctype(obj,MemberObject)
end if
End fucntion
Reply With Quote
Reply

Tags
maintaining, state, information, across, applications, pageloads

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Useful tools / applications mybmodel E-Commerce and Business 2 Mar 24th, 2008 09:31
Applications Engineer Web JobBot Job Opportunities 0 Nov 26th, 2006 08:45
Applications Engineer Web JobBot Job Opportunities 0 Oct 5th, 2006 22:34
Applications Engineer Web JobBot Job Opportunities 0 Oct 5th, 2006 22:18
Updating/maintaining site problem NovaGoth Web Page Design 6 Apr 17th, 2006 05:56


All times are GMT. The time now is 06:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43