Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maintaining Application State MIS3502: Application Integration and Evaluation Paul Weinberg Presentation by David Schuff.

Similar presentations


Presentation on theme: "Maintaining Application State MIS3502: Application Integration and Evaluation Paul Weinberg Presentation by David Schuff."— Presentation transcript:

1 Maintaining Application State MIS3502: Application Integration and Evaluation Paul Weinberg weinberg@temple.edu Presentation by David Schuff

2 The multi-page application? Actually, we’ve been creating multi-page applications all semester Access database: glenside.mdb …But the pages in our applications don’t communicate with each other, only with themselves (the postback), or an external data source (an Access database)

3 So? This has worked because we are completing the entire transaction within a single page Modification of a database record BUT If you need to gather data across multiple pages to complete a transaction, then this doesn’t work So you need a way to carry information across multiple pages

4 What is “state” Status of an application i.e., what are the values of the application’s variables The HTTP protocol is “stateless” One page doesn’t know what another page is doing So other things have to be done to get information from one page to another

5 Why is this tricky? Multiple amazon.com sessions… amazon.com application server Each session must be treated separately (i.e., different items in the shopping cart) This information has to be kept track of somewhere…

6 One option: Avoiding the issue (client-side) Post data from a form to a page This treats each page like a separate component Data has to be “handed off” from one component to another There are some odd ways this gets implemented Hidden HTML fields, complex URLs ASP.NET applications are set up to post data to themselves. This happens when we enable “AutoPostBack” in a DropDownList, or when a Button is clicked.

7 How to maintain state: Server-side The “session state” object ISAPI (Internet Server API) – Microsoft standard for doing this The application running at the server maintains the state for every connected session Communicates its state with the client

8 Session state object Goes away when the browser is closed Data is lost Is persistent across pages of the same browser session Can hold any data type =

9 How to maintain state: Client-side (cookie) The browser keeps track of data for other pages to “pick up” later Small text files saved to the local hard drive Does not go away when browser is closed (persistent) Can only hold string values Me like retaining values across multiple browser sessions!

10 When to use each? What situation would you want to use a session variable? What situation would you want to use a cookie? Is there one which you should avoid using?

11 Session Variables Server’s memory (RAM) State information about a session is maintained at the server Cookies Server’s memory (RAM) State information about a session is maintained at the browser Summary: Session Variables versus Cookies


Download ppt "Maintaining Application State MIS3502: Application Integration and Evaluation Paul Weinberg Presentation by David Schuff."

Similar presentations


Ads by Google