Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Server side. Internet technologies – Ohad © Server-side processing approaches  Server-side UI generation  PHP/ASP.net/JSP  Single Page Application."— Presentation transcript:

1 Server side

2 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

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

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

5 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

6 Internet technologies – Ohad © AJAX 6

7 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

8 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

9 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

10 Internet technologies – Ohad © Dynamic Web-Server 10 Parameter

11 Cookies

12 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

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

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

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

16 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

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

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

19 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

20 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

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


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

Similar presentations


Ads by Google