
diff -r 1280309e6bfc -r 4c40d4b2d01c slides01.tex
--- a/slides01.tex	Mon Sep 24 20:51:17 2012 +0100
+++ b/slides01.tex	Tue Sep 25 01:32:01 2012 +0100
@@ -376,6 +376,20 @@
 \end{tabular}
 \end{textblock}
 
+\begin{textblock}{1}(5.6,6)
+  \begin{tikzpicture}[scale=2.5]
+  \draw[white] (0,0) node (X) {};
+  \draw[white] (1,0) node (Y) {};
+  \only<1>{\draw[red, <-, line width = 2mm] (X) -- (Y);
+  \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};}
+  \only<2>{\draw[red, ->, line width = 2mm] (X) -- (Y);
+  \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X)!.5!(Y) $) {};}
+  \only<3>{\draw[red, <-, line width = 2mm] (X) -- (Y);
+  \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X)!.5!(Y) $) {};}
+  \end{tikzpicture}
+\end{textblock}
+
+
 \begin{textblock}{1}(9,5.5)
 \begin{tabular}{c}
 \includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
@@ -398,6 +412,8 @@
 \begin{frame}[c]
 \frametitle{\begin{tabular}{c}Scala + Play\end{tabular}}
 
+\footnotesize simple response from the server:
+
 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
 \texttt{\lstinputlisting{app0.scala}}}\bigskip
 
@@ -405,7 +421,7 @@
 alternative response:\\
 
 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
-\texttt{Ok("<H1>Hello world!</H1>").as(HTML)}}
+\texttt{\lstinline{Ok("<H1>Hello world!</H1>").as(HTML)}}}
 \end{frame}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
@@ -420,6 +436,105 @@
 \end{frame}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mode<presentation>{
+\begin{frame}[c]
+\frametitle{\begin{tabular}{c}Cookies\end{tabular}}
+
+
+\begin{textblock}{1}(1.5,5)
+\begin{tabular}{c}
+\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
+\small Servers from\\[-2mm] 
+\small Dot.com Inc.
+\end{tabular}
+\end{textblock}
+
+\begin{textblock}{1}(5.6,5.6)
+  \begin{tikzpicture}[scale=2.5]
+  \draw[white] (0,0) node (X) {};
+  \draw[white] (1,0) node (Y) {};
+  \draw[white] (0.05,-0.3) node (X1) {};
+  \draw[white] (0.95,-0.3) node (Y1) {};
+  \only<1-2>{\draw[red, <-, line width = 2mm] (X) -- (Y);
+  \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};}
+  \only<2>{\draw[red, <-, line width = 1mm] (X1) -- (Y1);
+  \node [inner sep=2pt,label=below:\textcolor{black}{read a cookie}] at ($ (X1)!.5!(Y1) $) {};}
+  \only<3->{\draw[red, ->, line width = 2mm] (X) -- (Y);
+  \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X)!.5!(Y) $) {};}
+  \only<3->{\draw[red, ->, line width = 1mm] (X1) -- (Y1);
+  \node [inner sep=2pt,label=below:\textcolor{black}{write a cookie}] at ($ (X1)!.5!(Y1) $) {};}
+  \end{tikzpicture}
+\end{textblock}
+
+
+\begin{textblock}{1}(9.5,5.5)
+\begin{tabular}{c}
+\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
+\small Client
+\end{tabular}
+\end{textblock}
+  
+\only<4->{  
+\begin{textblock}{13}(1,11)  
+\small\begin{itemize}
+\item cookies: max 4KB data\\[-2mm]
+\item cookie theft, cross-site scripting attacks\\[-2mm]
+\item session cookies, persistent cookies, HttpOnly cookies, third-party cookies, zombie cookies 
+\end{itemize}  
+\end{textblock}}
+
+\only<5>{
+\begin{textblock}{11}(1,3)
+\begin{tikzpicture}
+\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
+{\normalsize\color{darkgray}
+\begin{minipage}{10cm}\raggedright\small
+{\bf EU Privacy Directive about Cookies:}\smallskip\\
+``In May 2011, a European Union law was passed stating that websites that leave non-essential cookies on visitors' devices have to alert the visitor and get acceptance from them. This law applies to both individuals and businesses based in the EU regardless of the nationality of their website's visitors or the location of their web host. It is not enough to simply update a website's terms and conditions or privacy policy. The deadline to comply with the new EU cookie law was 26th May 2012 and failure to do so could mean a fine of up to \pounds{}500,000.''
+\end{minipage}};
+\end{tikzpicture}
+\end{textblock}}
+  
+\end{frame}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mode<presentation>{
+\begin{frame}[c]
+\frametitle{\begin{tabular}{c}My First Webapp\end{tabular}}
+
+{\bf GET request:}\smallskip
+\begin{enumerate}
+\item read cookie from client
+\item if none is present, set \texttt{visits} to \textcolor{blue}{$0$}
+\item if cookie is present, extract \texttt{visits}
+\item if \texttt{visits} is greater or equal \textcolor{blue}{$10$}, \\
+print valued customer message\\
+otherwise just normal message
+\item increase \texttt{visits} by \textcolor{blue}{$1$} and store new cookie with client
+\end{enumerate}
+
+  
+\end{frame}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mode<presentation>{
+\begin{frame}[c]
+\mbox{}\\[-9mm]
+
+{\lstset{language=Scala}\fontsize{8}{10}\selectfont
+\texttt{\lstinputlisting{app2.scala}}}
+
+  
+\end{frame}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+
+
+
 % linkedIn password
 % http://erratasec.blogspot.co.uk/2012/06/confirmed-linkedin-6mil-password-dump.html
 




