@@ -62,7 +62,7 @@ So when using RedisSessionHandler it is advised _not_ to disable `max_execution_
6262
6363### RedisSessionHandler does not support ` session.use_trans_sid=1 ` nor ` session.use_cookies=0 `
6464
65- It just not work at all with [ URL-based sessions] ( http://www.phpddt.com/usr/uploads/2013/09/2521893358.jpg ) . By design.
65+ It just don't work at all with [ URL-based sessions] ( http://www.phpddt.com/usr/uploads/2013/09/2521893358.jpg ) . By design.
6666
6767
6868### RedisSessionHandler ignores the ` session.use_strict_mode ` directive
@@ -109,7 +109,7 @@ First, we send a single request that will setup a new session. Then we use the s
109109the ` Set-Cookie ` header to send a burst of 200 concurrent, authenticated requests.
110110
111111``` bash
112- 1ma@home: ~ $ http localhost/visit-counter.php
112+ $ http localhost/visit-counter.php
113113HTTP/1.1 200 OK
114114Cache-Control: no-store, no-cache, must-revalidate
115115Connection: keep-alive
@@ -123,7 +123,7 @@ Transfer-Encoding: chunked
123123
1241241
125125
126- 1ma@home: ~ $ hey -n 200 -H " Cookie: PHPSESSID=9mcjmlsh9gp0conq7i5rci7is8gfn6s0gh8r3eub3qpac09gnh21;" http://localhost/visit-counter.php
126+ $ hey -n 200 -H " Cookie: PHPSESSID=9mcjmlsh9gp0conq7i5rci7is8gfn6s0gh8r3eub3qpac09gnh21;" http://localhost/visit-counter.php
127127All requests done.
128128
129129Summary:
@@ -176,7 +176,7 @@ one, just as if it was not received at all. Unfortunately the phpredis handler i
176176the HTTP request.
177177
178178``` bash
179- 1ma@home: ~ $ http -v http://localhost/visit-counter.php Cookie:PHPSESSID=madeupkey
179+ $ http -v http://localhost/visit-counter.php Cookie:PHPSESSID=madeupkey
180180GET / HTTP/1.1
181181Accept: * /*
182182Accept-Encoding: gzip, deflate
@@ -195,7 +195,7 @@ Pragma: no-cache
195195
1961961
197197
198- 1ma@home: ~ $ redis-cli
198+ $ redis-cli
199199
200200127.0.0.1:6379> keys *
2012011) " PHPREDIS_SESSION:madeupkey"
@@ -218,24 +218,44 @@ In order to run the integration test suite just type `composer test` and it will
218218the dev dependencies, setting up the testing containers and running the tests.
219219
220220``` bash
221- 1ma@home: ~ /RedisSessionHandler $ composer test
221+ $ composer test
222222Loading composer repositories with package information
223223Installing dependencies (including require-dev) from lock file
224224Nothing to install or update
225225Generating autoload files
226226> docker-compose -f tests/docker-compose.yml up -d
227227tests_redis_1 is up-to-date
228- tests_fpm_1 is up-to-date
229- tests_monitor_1 is up-to-date
228+ tests_fpm56_1 is up-to-date
229+ tests_fpm71_1 is up-to-date
230+ tests_fpm70_1 is up-to-date
231+ tests_redis_monitor_1 is up-to-date
230232tests_nginx_1 is up-to-date
231- tests_testrunner_1 is up-to-date
232- > docker exec -t tests_testrunner_1 sh -c ' vendor/bin/phpunit'
233+ tests_runner_1 is up-to-date
234+ > docker exec -t tests_runner_1 sh -c " TARGET=php56 vendor/bin/phpunit"
233235stty: standard input
234- PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
236+ PHPUnit 6.2.3 by Sebastian Bergmann and contributors.
235237
236238................ 16 / 16 (100%)
237239
238- Time: 582 ms, Memory: 6.00MB
240+ Time: 1.39 seconds, Memory: 4.00MB
241+
242+ OK (16 tests, 54 assertions)
243+ > docker exec -t tests_runner_1 sh -c " TARGET=php70 vendor/bin/phpunit"
244+ stty: standard input
245+ PHPUnit 6.2.3 by Sebastian Bergmann and contributors.
246+
247+ ................ 16 / 16 (100%)
248+
249+ Time: 1.29 seconds, Memory: 4.00MB
250+
251+ OK (16 tests, 54 assertions)
252+ > docker exec -t tests_runner_1 sh -c " TARGET=php71 vendor/bin/phpunit"
253+ stty: standard input
254+ PHPUnit 6.2.3 by Sebastian Bergmann and contributors.
255+
256+ ................ 16 / 16 (100%)
257+
258+ Time: 1.08 seconds, Memory: 4.00MB
239259
240260OK (16 tests, 54 assertions)
241261```
@@ -253,26 +273,53 @@ enabled and the FPM container will automatically choose the phpredis save handle
253273```
254274
255275``` bash
256- 1ma@home: ~ /RedisSessionHandler $ composer test
276+ $ composer test
257277Loading composer repositories with package information
258278Installing dependencies (including require-dev) from lock file
259279Nothing to install or update
260280Generating autoload files
261281> docker-compose -f tests/docker-compose.yml up -d
262282tests_redis_1 is up-to-date
263- tests_monitor_1 is up-to-date
264- tests_fpm_1 is up-to-date
283+ tests_fpm56_1 is up-to-date
284+ tests_fpm71_1 is up-to-date
285+ tests_fpm70_1 is up-to-date
286+ tests_redis_monitor_1 is up-to-date
265287tests_nginx_1 is up-to-date
266- tests_testrunner_1 is up-to-date
267- > docker exec -t tests_testrunner_1 sh -c ' vendor/bin/phpunit'
288+ tests_runner_1 is up-to-date
289+ > docker exec -t tests_runner_1 sh -c " TARGET=php56 vendor/bin/phpunit"
268290stty: standard input
269- PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
291+ PHPUnit 6.2.3 by Sebastian Bergmann and contributors.
270292
271293...FFF..FF...... 16 / 16 (100%)
272294
273- Time: 695 ms , Memory: 6 .00MB
295+ Time: 1.15 seconds , Memory: 4 .00MB
274296
275297There were 5 failures:
276298
277299~ ~snip~~
278300```
301+
302+
303+ ### Manual testing
304+
305+ The ` docker-compose.yml ` file is configured to expose a random TCP port linked to the nginx container port 80. After running
306+ ` composer env-up ` or ` composer test ` you can see which one was assigned with ` docker ps ` . With that knowledge you can
307+ poke the testing webserver directly from your local machine using either a regular browser, cURL, wrk or similar tools.
308+
309+ Depending on your Docker setup you might need to replace ` localhost ` with the IP of the virtual machine that actually runs the Docker daemon:
310+
311+ ``` bash
312+ $ curl -i localhost:32768/visit-counter.php? with_custom_cookie_params
313+ HTTP/1.1 200 OK
314+ Server: nginx/1.13.1
315+ Date: Sat, 15 Jul 2017 09:40:25 GMT
316+ Content-Type: text/html; charset=UTF-8
317+ Transfer-Encoding: chunked
318+ Connection: keep-alive
319+ Set-Cookie: PHPSESSID=tqm3akv0t5gdf25lf1gcspn479aa989jp0mltc3nuun2b47c7g10; expires=Sun, 16-Jul-2017 09:40:25 GMT; Max-Age=86400; path=/; secure; HttpOnly
320+ Expires: Thu, 19 Nov 1981 08:52:00 GMT
321+ Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
322+ Pragma: no-cache
323+
324+ 1
325+ ```
0 commit comments