Skip to content

Commit

Permalink
styles: format
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jun 16, 2021
1 parent d29ea69 commit 5cc9fc3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions docs/docs/guides/login-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,22 @@ A typical session payload will look like this:
</TabItem>
</Tabs>

If you have the session cookie available from another source you can also use the `X-Session-Token`
header:
If you have the session cookie available from another source you can also use
the `X-Session-Token` header:

```js
app.get('/', function (req, res) {
// Cookies that have not been signed
const cookie = req.cookies['ory_kratos_session']
// Make a request and include the cookie in X-Session-Cookie
fetch('https://playground.projects.oryapis.com/api/kratos/public/sessions/whoami', {
headers: {'X-Session-Cookie': cookie}
}).then((res) => res.json())
fetch(
'https://playground.projects.oryapis.com/api/kratos/public/sessions/whoami',
{
headers: { 'X-Session-Cookie': cookie }
}
)
.then((res) => res.json())
.then((session) => console.log(session))
})
```
Expand Down

0 comments on commit 5cc9fc3

Please sign in to comment.