File tree Expand file tree Collapse file tree
examples/read-and-set-http-cookies Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11services :
22 web :
3- build : .
3+ image : lovasoa/sqlpage:main
44 ports :
55 - " 8080:8080"
6+ volumes :
7+ - .:/var/www
8+ - ./sqlpage:/etc/sqlpage
Original file line number Diff line number Diff line change 11-- Sets the username cookie to the value of the username parameter
22SELECT ' cookie' as component,
33 ' username' as name,
4- $ username as value
5- WHERE $ username IS NOT NULL ;
4+ : username as value
5+ WHERE : username IS NOT NULL ;
66
77SELECT ' form' as component;
88SELECT ' username' as name,
99 ' User Name' as label,
10- COALESCE($ username, sqlpage .cookie (' username' )) as value,
10+ COALESCE(: username, sqlpage .cookie (' username' )) as value,
1111 ' try leaving this page and coming back, the value should be saved in a cookie' as description;
1212
1313select ' text' as component;
1414select ' log out' as contents, ' logout.sql' as link;
1515
1616select ' text' as component;
17- select ' View the cookie from a subdirectory' as contents, ' subdirectory/read_cookies.sql' as link;
17+ select ' View the cookie from a subdirectory' as contents, ' subdirectory/read_cookies.sql' as link;
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ GET http://localhost:8080/
2+ HTTP 200
3+ [Asserts]
4+ body contains "User Name"
5+ body contains "View the cookie from a subdirectory"
6+ body not contains "An error occurred"
7+
8+ POST http://localhost:8080/
9+ [FormParams]
10+ username : Hurl Cookie
11+ HTTP 200
12+ [Asserts]
13+ header "Set-Cookie" contains "username=Hurl%20Cookie"
14+ body contains "Hurl Cookie"
15+ body not contains "An error occurred"
16+
17+ GET http://localhost:8080/
18+ HTTP 200
19+ [Asserts]
20+ body contains "Hurl Cookie"
21+ body not contains "An error occurred"
22+
23+ GET http://localhost:8080/subdirectory/read_cookies.sql
24+ HTTP 200
25+ [Asserts]
26+ body contains "The value of your username cookie was: Hurl Cookie"
27+ body contains "It has now been removed"
28+ body not contains "An error occurred"
29+
30+ GET http://localhost:8080/
31+ HTTP 200
32+ [Asserts]
33+ body not contains "Hurl Cookie"
34+ body not contains "An error occurred"
You can’t perform that action at this time.
0 commit comments