Q:

How to pass JSON Web Tokens to different web pages after successful login?

I have a set of web pages that makes use of some APIs that need JWT as a header for authentication. This JWT is generated after success login. What would be the most appropriate way of sending jwt from one page to another after a successful login?

A:

You can use either of these to store JWTs: 

HTML5 Web Storage (localStorage or sessionStorage)
Cookies

As explained in this article store JWT in cookies for web applications, because of the additional security they provide.

What would be the most appropriate way of sending jwt from one page to another after a successful login?

Retrieve token from cookie/web storage in another page.

