State Handling CS 4640 Programming Languages for Web Applications

Slides:



Advertisements
Similar presentations
PHP and CSS to control web apps styles. CSS is used to style today’s web applications.
Advertisements

Cutting Edge Research in Engineering of Web Applications Part 2 What is Different about Engineering Web Apps? Jeff Offutt Professor of Software Engineering.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Active Server Pages Chapter 1. Introduction Understand how browsers and servers interacted when the Web was young Understand what early Internet and intranet.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
CS453: State in Web Applications (Part 1) State in General Sessions (esp. in PHP) Prof. Tom Horton.
CS4273: Distributed System Technologies and Programming Lecture 13: Review.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Chapter 6 Server-side Programming: Java Servlets
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
Maintaining Application State MIS3502: Application Integration and Evaluation Paul Weinberg Presentation by David Schuff.
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
Saving State on the WWW. The Issue  Connections on the WWW are stateless  Every time a link is followed is like the first time to the server — it has.
Sessions and Cookies State Management, Cookies, Sessions, Hidden Fields SoftUni Team Technical Trainers Software University
SE-2840 Dr. Mark L. Hornick1 Servlet Threads and Sessions.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
©SoftMooreSlide 1 Session Tracking with Servlets.
The basics of knowing the difference CLIENT VS. SERVER.
Web Technologies Lecture 6 State preservation. Motivation How to keep user data while navigating on a website? – Authenticate only once – Store wish list.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Distributed Web Systems Cookies and Session Tracking Lecturer Department University.
National College of Science & Information Technology.
Upsorn Praphamontripong CS Design and Implementation of Software for the Web Fall 2016 State Handling on the Web.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
6. Application Server Issues for the Project
Usability Overview Upsorn Praphamontripong CS
Web Programming Language
Managing State Chapter 13.
Web Technologies Computing Science Thompson Rivers University
Introduction to Unique Aspects of Web Applications
WWW and HTTP King Fahd University of Petroleum & Minerals
Netscape Application Server
Sessions Many interactive Web sites spread user data entry out over several pages: Ex: add items to cart, enter shipping information, enter billing information.
Principles of Network Applications
Scope and State Handling in JSPs
Web Software Model CS 4640 Programming Languages for Web Applications
Session Tracking in Servlets
Introduction to J2EE Architecture
PHP / MySQL Introduction
Client-Server Interaction
Introduction to Web Applications
Design and Maintenance of Web Applications in J2EE
Chapter 26 Servlets.
Web Systems Development (CSC-215)
Lecture 1: Multi-tier Architecture Overview
Introduction to Servlets
Handling State in Java Servlets
Handling State in Web Applications
Session Tracking Techniques
Sessions Many interactive Web sites spread user data entry out over several pages: Ex: add items to cart, enter shipping information, enter billing information.
Building ASP.NET Applications
Scope and State Handling in Java Server Pages
WPS - your story so far Seems incredible complicated, already
Back end Development CS Programming Languages for Web Applications
COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require understanding.
Web Technologies Computing Science Thompson Rivers University
Client-Server Model: Requesting a Web Page
[Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU]
Web Servers (IIS and Apache)
Web Software Model CS 4640 Programming Languages for Web Applications
Back end Development CS Programming Languages for Web Applications
State Handling CS 4640 Programming Languages for Web Applications
[Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU]
Asynchronous Programming CS Programming Languages for Web Applications
Presentation transcript:

State Handling CS 4640 Programming Languages for Web Applications [Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU] [Robert W. Sebesta, “Programming the World Wide Web]

Interactions in Web Apps revisit Interactions in Web Apps Web server Web application Web component1 Web component2 Web componentn HTTP Request Request Web client HTTP Response Response Each request/response is treated independently 1st interaction  1st request/response “Connectionless” “Stateless” 2nd interaction  2nd request/response

Session State Information The initial versions of the web suffered from a lack of state If a web app needed multiple screens, there was no way for state to be accumulated or stored This is due to the stateless property of HTTP In reality, we may want to keep track of the information (i.e., state) HTML Form Server Page State data response S1 S1+S2+S3 Form1 Form2 Form3 Server Form4 S1+S2 S1+S2+S3+S4

Session Tracking Web sites that are service-oriented or e-commerce need to maintain user state This is called session tracking Session = a series of related interactions between a client and a web server Session tracking = keeping data between multiple HTTP requests The web brings in unique constraints: HTTP is connectionless Web apps are distributed

Public access and parameter passing are not enough for web apps State on the Web Two assumptions (traditional software): The software components share physical memory The program runs to completion with active memory These assumptions are violated in web apps due to Distributed software components Connectionless nature of HTTP Need ways to store and access variables and objects to keep state in web apps Public access and parameter passing are not enough for web apps

State and Session Tracking Passing data from one HTTP request to another A web app Composed of several web software components Web components do not communicate directly Independent processes (threads) Connectionless protocol Client-server or N-tier architecture Execution flow always goes through a client How can these independent components share data ?

Session Tracking Methods URL rewriting -- include data as extra parameters Hidden form fields Cookies Server-side session objects All four methods work by exchanging a token between the client and server Server Client UI implemented in a browser Web server Container engine Program components HTTP Request (with a token / data) HTTP Response (with a token / HTML)

URL Rewriting Forms usually add parameters You can add value in the URL as parameters The above example is used as a key to find the saved information about the user upsorn Drawback Messy and clumsy Long URLs Information on URL is public All HTML pages must be created dynamically URL?P1=v1&P2=v2&P3=v3& ... href="../phpname?User=upsorn">

Hidden Form Fields Flows of control go through the client Store data to be passed from one software component to another in hidden form fields in the HTML Generate HTML pages with forms that store “hidden” information Several problems: Insecure – users can see the data Unreliable – users can change the data Undependable – users can use the back button, direct URL entry, and URL rewriting to skip some hidden form fields Still useful in limited situations <input type=“hidden” name=“User” value=“upsorn” />

Summary Managing state is fundamental to any program Managing state is the most unique aspect of designing and programming web applications URL rewriting can be used to maintain state – but messy and insecure Hidden form fields can be used to keep track of state – but insecure, unreliable, undependable What’s next? Session tracking with cookies Session tracking with PHP session objects