0% found this document useful (0 votes)
13 views1 page

Take Token From Cookies

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Take Token From Cookies

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

string tokenCookie = HttpContext.Request.

Cookies["jwt"];
var handler = new JwtSecurityTokenHandler();
var token = handler.ReadJwtToken(tokenCookie);
var cardNumberFromToken = token.Claims.FirstOrDefault(c => c.Type ==
"CardNumber");
var cardNumber = cardNumberFromToken.Value;

You might also like