Skip to content

Instantly share code, notes, and snippets.

@wederbrand
Created October 2, 2018 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wederbrand/736ab7daf84d24c223e1c38eb80a6d52 to your computer and use it in GitHub Desktop.
Save wederbrand/736ab7daf84d24c223e1c38eb80a6d52 to your computer and use it in GitHub Desktop.
insomnia cookie error
<?php
setcookie ( "insomnia-cookie", "expires soon", time()+10)
?>
Hello

instructions

installation

Run a local php/apache container with one simple index.php file docker run -d -p 80:80 --name php -v "$PWD":/var/www/html php:rc-apache This file sets a cookie named insomnia-cookie with 10 seconds expiry

Import the supplied namespace named "insomnia cookies"

error

Run the first request, a cookie is stored in the cookie jar and is usable in the second request. Wait 10 seconds (sometimes a little more) The cookie in the second call gets marked red and the request wont send

Re-run the first call, this should replace the cookie and it does, according to the cookie jar. It is however still not available to that second call.

Delete the cookie, run the first call. Cookie is now available again.

{
"_type": "export",
"__export_format": 3,
"__export_date": "2018-10-02T22:27:59.197Z",
"__export_source": "insomnia.desktop.app:v6.0.2",
"resources": [
{
"_id": "wrk_76ed251769f246a6a0018382512b168b",
"created": 1538518721915,
"description": "",
"modified": 1538518721915,
"name": "insomnia cookies",
"parentId": null,
"_type": "workspace"
},
{
"_id": "env_f38540013dbc422c87a1590b658bbe97",
"color": null,
"created": 1538518722275,
"data": {},
"isPrivate": false,
"metaSortKey": 1538518722276,
"modified": 1538518722275,
"name": "New Environment",
"parentId": "wrk_76ed251769f246a6a0018382512b168b",
"_type": "environment"
},
{
"_id": "jar_9e680df785b74e58816a5ad85e5bd241",
"cookies": [],
"created": 1538518722300,
"modified": 1538519262717,
"name": "Default Jar",
"parentId": "wrk_76ed251769f246a6a0018382512b168b",
"_type": "cookie_jar"
},
{
"_id": "req_c156079c6a674f5bbd213fe51ffeb0e4",
"authentication": {},
"body": {},
"created": 1538518730887,
"description": "",
"headers": [],
"isPrivate": false,
"metaSortKey": -1538518733887,
"method": "GET",
"modified": 1538518873021,
"name": "get cookie",
"parameters": [],
"parentId": "wrk_76ed251769f246a6a0018382512b168b",
"settingDisableRenderRequestBody": false,
"settingEncodeUrl": true,
"settingMaxTimelineDataSize": 1000,
"settingRebuildPath": true,
"settingSendCookies": false,
"settingStoreCookies": true,
"url": "localhost",
"_type": "request"
},
{
"_id": "req_565f33405e6e41079538c07babcf0465",
"authentication": {},
"body": {},
"created": 1538518733837,
"description": "",
"headers": [
{
"id": "pair_a1d4ed0ee4b54f558569600fc51a5ae7",
"name": "Cookie",
"value": "{% cookie 'http://localhost', 'insomnia-cookie' %}"
}
],
"isPrivate": false,
"metaSortKey": -1538518733837,
"method": "GET",
"modified": 1538518867924,
"name": "use cookie",
"parameters": [],
"parentId": "wrk_76ed251769f246a6a0018382512b168b",
"settingDisableRenderRequestBody": false,
"settingEncodeUrl": true,
"settingMaxTimelineDataSize": 1000,
"settingRebuildPath": true,
"settingSendCookies": false,
"settingStoreCookies": false,
"url": "localhost",
"_type": "request"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment