Server side. Internet technologies – Ohad © Server-side processing approaches  Server-side UI generation  PHP/ASP.net/JSP  Single Page Application.

Slides:



Advertisements
Similar presentations
Testing Web Applications & Services Testing Web Applications & Web Services.
Advertisements

CookiesPHPMay-2007 : [‹#›] Maintaining State in PHP Part I - Cookies.
Lesson 8 Cookies. What is a cookie A little “tarball” of information stored on the client machine’s hard drive. –Usually in the cookies.txt file –information.
How the web works: HTTP and CGI explained
XP Tutorial 9 New Perspectives on JavaScript, Comprehensive1 Working with Cookies Managing Data in a Web Site Using JavaScript Cookies.
Definitions, Definitions, Definitions Lead to Understanding.
Session Management A290/A590, Fall /25/2014.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
CGI. CGI Programming What is "CGI"? –Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept.
Web technologies and programming cse hypermedia and multimedia technology Fanis Tsandilas April 3, 2007.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
CHAPTER 12 COOKIES AND SESSIONS. INTRO HTTP is a stateless technology Each page rendered by a browser is unrelated to other pages – even if they are from.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Working with Cookies Managing Data in a Web Site Using JavaScript Cookies* *Check and comply with the current legislation regarding handling cookies.
CSE 154 LECTURE 12: COOKIES. Including files: include include("filename"); PHP include("header.html"); include("shared-code.php"); PHP inserts the entire.
Web Programming Language Week 7 Dr. Ken Cosh Security, Sessions & Cookies.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Cookies Web Browser and Server use HTTP protocol to communicate and HTTP is a stateless protocol. But for a commercial website it is required to maintain.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
A Little Bit About Cookies Fort Collins, CO Copyright © XTR Systems, LLC A Little Bit About Cookies Instructor: Joseph DiVerdi, Ph.D., M.B.A.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
Persistence Maintaining state using cookies and queries.
RESTful Web Services What is RESTful?
Cookies. Cookie A cookie is a method for a Web server to maintain state information about users as users navigate different pages on the site, and as.
Creating Animations, Working with Graphics, and Accessing Data Lesson 9.
 A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Some from Chapter 11.9 – “Web” 4 th edition and SY306 Web and Databases for Cyber Operations Cookies and.
Programming for the Web Cookies & Sessions Dónal Mulligan BSc MA
Web Storage and Cookies Cookies, Local and Session Storage SoftUni Team Technical Trainers Software University
File Uploads and Cookies Pat Morin COMP Outline File upload Cookies.
National College of Science & Information Technology.
The need for persistence Consider these examples  Counting the number of “hits” on a website  i.e. how many times does a client load your web page source.
Web fundamentals: Clients, Servers, and Communication
CSE 154 Lecture 20: Cookies.
Tiny http client and server
Node.js Express Web Applications
How does it work ?.
Data Virtualization Tutorial… CORS and CIS
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Sessions and cookies (part 2)
Client / Session Identification Cookies
Web Programming Language
Cookies and Sessions in PHP
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
Implementing Cookies in PHP
14-мавзу. Cookie, сеанс, FTP и технологиялари
Cookies and JavaScript
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
Client / Session Identification Cookies
Radu Mariescu-Istodor
Session Tracking Techniques
CSc 337 Lecture 27: Cookies.
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
CS3220 Web and Internet Programming Cookies and Session Tracking
Web Programming Language
Advanced Concepts and AJAX
Client-Server Model: Requesting a Web Page
[Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU]
CSc 337 Lecture 25: Cookies.
Presentation transcript:

Server side

Internet technologies – Ohad © Server-side processing approaches  Server-side UI generation  PHP/ASP.net/JSP  Single Page Application (aka SPA)  Angular.js, Backbone, Ember  Hybrid 2

Internet technologies – Ohad © Server-side UI generation example  Inbox.*sp 3

Internet technologies – Ohad © Server-side UI generation example  /preview/mail.*sp 4

Internet technologies – Ohad © Single Page Application 1. WS sends static HTML file 2. The HTML file build itself (via JavaScript) 3. The HTML file sends AJAX requests to the server 1. The server returns DATA not HTML 2. JavaScript parse the data and rerender the page 4. Advantages: 1. Less data over the network 2. Static resources are cacheable (CDNs) 3. Reduced operation cost 5

Internet technologies – Ohad © AJAX 6

Internet technologies – Ohad © JSON  JavaScript Object Notation  JSON vs. JavaScript Object  Only 6 value types: json, array, number, string, boolean and null  No function literal, No Undefined  Keys must be String  No identifier  JSON is String. 7

Internet technologies – Ohad © JSON and AJAX  JSON is a great format for AJAX responses.  JSON.parse(str) – converts JSON to Object  JSON.stringify(obj) - converts Object to JSON 8

Internet technologies – Ohad © Dynamic Web-Server  Simple as  Receives an HTTP request  Do whatever processing you had like  Reply with whatever HTTP response you had like  REST standards  Stateless server-side processing  Cache as much as possible  Meaningful HTTP request method 9

Internet technologies – Ohad © Dynamic Web-Server 10 Parameter

Cookies

Internet technologies – Ohad © Cookies  Web Server can send a piece of information to the browser (this is the cookie)  The browser save it as a file  And send it back to the server (upon every new request)  Cookie is a key/value thing 12

Internet technologies – Ohad © How?  Utilizing HTTP headers 13

Internet technologies – Ohad © Response  HTTP/ OK Content-type: text/html Set-Cookie: name=value Set-Cookie: name2=value2; Expires=Wed, 09 Jun :18:14 GMT 14

Internet technologies – Ohad © Every new request  GET /spec.html HTTP/1.1 Host: Cookie: name=value; name2=value2 Accept: */* 15

Internet technologies – Ohad © Domain and Path  Set specific domain and path  Set-Cookie: someKey=someVal; Domain=.nba.com; Path=/jordan;  Default to the domain and path of the object that was requested. 16

Internet technologies – Ohad © JavaScript..  One can access cookies by  document.cookies  Why this is a security vulnerability? 17

Internet technologies – Ohad © Security  You can use HttpOnly  No javascript access  And Secure  Only via SSL Set-Cookie: thisIs=good; HttpOnly; Secure; 18

Internet technologies – Ohad © Can we trust a cookie to stay there?  NO!  Why?  Because  The user can delete cookies..  The user can disable cookies…  The user can switch machines… 19

Internet technologies – Ohad © Third-party cookie  The browser is located in domain A  But it loads image/ad from domain B  Domain B sets a cookie…  This is ½ legal… 20

Internet technologies – Ohad © Usage  Remember Me?  Any type of settings..  Tracking 21