Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 592 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 592 Bytes

Cookie Share

Proof of concept sharing cookies across different web services running on the same domain (localhost) but different ports.

API

Start the API on port 4000

cd api
php -S localhost:4000

Web

Start the web server on port 8000

cd web
python3 -m http.server 8000

Test

Visit the API in the browser setting whatever test value you want to see http://localhost:4000?testvar=shared-cookie

  1. API will set a cookie value on port 4000
  2. API will redirect to web server on port 8000
  3. JS on web page will read cookie value and print it on screen