How to retain information across multiple servers ?http://forums.asp.net/t/1755333.aspx/1?How+to+retain+information+across+multiple+servers+Tue, 17 Jan 2012 06:07:06 -050017553334761997http://forums.asp.net/p/1755333/4761997.aspx/1?How+to+retain+information+across+multiple+servers+How to retain information across multiple servers ? <p>I have&nbsp;a web application&nbsp;in which I have used session variable to store the information. Now we are&nbsp;migrating the application to multiple server kind of environment.&nbsp;So I need to know how we can achieve that. I have heard something like &quot;webstate&quot;&nbsp;can help in this scenario and I am not new in asp.net but I am fairly new to this term(may be a multiple server thing which I have no idea), All I have known so far is session, cookies,cache, query string,viewstate and some others that asp.net support.</p> <p>and I am thinking of using query string for passing infromation while navigating between pages and store that information into view state for each page which will be available during postbacks as well.</p> <p>Can anyone please guide how I can retain the information across multiple servers and what problems I am likely to&nbsp;face and how am I proceeding?</p> 2012-01-03T13:12:04-05:004762021http://forums.asp.net/p/1755333/4762021.aspx/1?Re+How+to+retain+information+across+multiple+servers+Re: How to retain information across multiple servers ? <p>You would need to change the Session mode from &quot;InProc&quot; to either StateServer or SqlServer.</p> <p>For an overview of Session State modes, see this article: &nbsp;<a href="http://msdn.microsoft.com/en-us/library/ms178586.aspx">http://msdn.microsoft.com/en-us/library/ms178586.aspx</a></p> <p>For a session state server, check out Windows Server AppFabric, a high-performance in-memory cache that also can serve as a Session State Provider for ASP.NET: &nbsp;<a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849">http://msdn.microsoft.com/en-us/windowsserver/ee695849</a></p> 2012-01-03T13:20:02-05:004762029http://forums.asp.net/p/1755333/4762029.aspx/1?Re+How+to+retain+information+across+multiple+servers+Re: How to retain information across multiple servers ? <p>For what you have described, the session state need to be reviewed. You are moving to a web farm environment, and the session object used to run in-process in a standalone web server setup need to be serializable. Other methods of persisting data for the web user should be able to keep the way it is.</p> <p>There is a comparison of technology that persisting data: <a href="http://msdn.microsoft.com/en-us/magazine/cc300437.aspx"> http://msdn.microsoft.com/en-us/magazine/cc300437.aspx</a></p> <p>Just make sure you are not storing sensitive information on the client. </p> 2012-01-03T13:24:23-05:004762055http://forums.asp.net/p/1755333/4762055.aspx/1?Re+How+to+retain+information+across+multiple+servers+Re: How to retain information across multiple servers ? <p>Thanks both for your Quick replies.&nbsp; I understand these options are to keep the code for session as is. Could you please tell me</p> <p>1. Is there something like &quot;webstate&quot; which can help in this&nbsp;scenario&nbsp;?</p> <p>&nbsp;I am unsure if its viewstate what is being referred here.</p> <p>2. Is my solution(mix of query string&nbsp;&#43;&nbsp;viewstate)&nbsp;any good in this scenario ?</p> <p>3. Just making changes in Web.config(for session state)&nbsp;would be enough to move to new environment ?</p> <p>&nbsp;I understand that your approach seems to be best solution. I&nbsp;search net and found everyone focussing on changing session state in multiple server scenario.&nbsp;</p> 2012-01-03T13:42:05-05:004762154http://forums.asp.net/p/1755333/4762154.aspx/1?Re+How+to+retain+information+across+multiple+servers+Re: How to retain information across multiple servers ? <p>The nature of the web is stateless, there is no magic &quot;webstate&quot;. That's why there are various solution to overcome this stateless behavior of web.</p> <p>ViewState is basically a hidden value, but with some modifications to prevent average user reading the data out of it. However, it can still be decrypted, and it also increases the page size.</p> <p>QueryString is clearly defined in the URL, and different browsers have different char limits on how long the URL they can handle. Definitely not suitable for storing large size data.</p> <p>Both ViewState and QueryString are not suitable to store sensitive data.</p> <p>To change the session state provider from in-proc to state-server, you need to verify that types of your session objects are all serializable. If they are ALL of string types, then you are in luck, otherwise, you need to verify each object type making sure they are all serializable. There are cases such as potential circular reference scenario apply to the object is very difficult to serialize. Hence, changing the setting in the web.config is just a trivial step in the migration to state-server based solution.</p> <p></p> 2012-01-03T14:44:55-05:004763357http://forums.asp.net/p/1755333/4763357.aspx/1?Re+How+to+retain+information+across+multiple+servers+Re: How to retain information across multiple servers ? <p>Thanks very much for help!</p> 2012-01-04T06:29:05-05:004786842http://forums.asp.net/p/1755333/4786842.aspx/1?Re+How+to+retain+information+across+multiple+servers+Re: How to retain information across multiple servers ? <p>I&nbsp;discovered that Webstate is actually an internal implementation here which the&nbsp;people&nbsp;are referring to.&nbsp;A standard approach for storing the state on to a sql server table for sessions.</p> 2012-01-17T06:07:06-05:00