{"id":1203509,"date":"2019-05-21T11:11:56","date_gmt":"2019-05-21T09:11:56","guid":{"rendered":"https:\/\/wp-rocket.me\/?p=1203509"},"modified":"2021-07-29T10:04:16","modified_gmt":"2021-07-29T08:04:16","slug":"difference-json-web-tokens-vs-session-cookies","status":"publish","type":"post","link":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/","title":{"rendered":"JSON Web Tokens vs. Session Cookies: What&#8217;s the Difference?"},"content":{"rendered":"<p>JSON Web Tokens and session cookies both offer user authentication for websites and apps, but they\u2019re not the same thing.<br><\/p><p>Below are more details on JSON web tokens and session cookies as well as the main differences between them.<\/p><h2 class=\"wp-block-heading\">Similarities Between JSON Web Tokens and Session Cookies<\/h2><p>Before getting into the differences between JSON web tokens and session cookies, it\u2019s essential to first understand their main similarity. They can both be used to authenticate users as well as when they click through to different pages, and after logging into a website or app.<br><\/p><p>Without them, for example, you would have to keep logging in after each page you click to visit.<br><\/p><p>The foundation of the web is the Hypertext Transfer Protocol (HTTP). It transmits data such as HTML documents.<br><\/p><p>It\u2019s also stateless. This means that when you visit a web page, then click through to another one on the same site, your previous actions aren\u2019t remembered in the server\u2019s memory.<br><\/p><p>So, if you logged in and visited another page that you should have access to, you would be forced to log in again since HTTP wouldn\u2019t keep a record of the fact that you just signed in.<br><\/p><p>Both JSON web tokens and sessions cookies resolve this issue by keeping certain user data authenticated at each new request.<br><\/p><p>In other words, both options keep your logged in status on record so you can browse as many password-protected pages of a website as you want without having to sign in again \u2013 at least for the duration of your visit, or until you log out.<br><\/p><p>Both JSON web tokens and session cookies are also secure options you can use.<br><\/p><p>That\u2019s about where the similarities end. So, what are the main differences between JSON web tokens and session cookies?<\/p><h2 class=\"wp-block-heading\">What are Session Cookies?<\/h2><p><a href=\"https:\/\/wp-rocket.me\/blog\/browser-cache-vs-cookies-difference\/\">Session cookies make use of session-based authentication<\/a>. A user\u2019s logged in state is saved in the server\u2019s memory.<br><\/p><p>After a user signs in, a session is securely created by the server. Then, that session ID is stored in a session cookie on the user\u2019s browser. While the user remains logged in, the cookie is sent with every subsequent request.<br><\/p><p>At each request, the server takes a look at the session cookie to read the session ID. If it matches the data stored in its memory, it sends a response back to the browser letting it know everything\u2019s okay and ready to go.<br><\/p><p>That\u2019s when the session is authenticated and the user is free to browse the password-protected page. When they click to another protected page, the process repeats.<\/p><h2 class=\"wp-block-heading\">What are JSON Web Tokens?<\/h2><p>JSON Web Token is often abbreviated to JWT and is commonly pronounced as \u201cjot.\u201d<br><\/p><p>A JSON web token takes JASON data, called a claim, and transfers it securely. It does this by cryptographically signing the claim. The signature is either symmetrically or asymmetrically signed, but both offer authentication.<br><\/p><p>This process is a form of token-based authentication.<br><\/p><p>JSON web tokens work in a similar way as a bank account number on a cheque, and the signature that\u2019s placed on it to approve the transfer of money with the cheque.<br><\/p><p>If you\u2019re renting an apartment and wanted to pay rent by cheque, your name attached to your bank account number is similar to a claim.<br><\/p><p>It\u2019s basic details about you that needs to be passed along if you want to pay your rent. It\u2019s similar to a claim because a claim would have a few details about you that\u2019s saved after you log in or otherwise have your identity authorized in order to visit password-protected pages.<br><\/p><p>You being able to use the website or app after logging in would be like paying your rent in this analogy.<br><\/p><p>The cheque would also include your signature. Your signature is specifically unique to you, and lets the bank know that you authorize the transaction. Because this signature is unique to you, the bank can be confident that you are who you say you are, and the transaction is able to go through.<br><\/p><p>Your signature on the cheque is like a JSON web token\u2019s cryptographic signature. In a JWT, this signature is able to authorize that it\u2019s definitely you wanting to access a site or an app.<br><\/p><p>But here\u2019s the kicker: What if your landlord or landlady didn\u2019t get your signed cheque with your bank account number and name? What if you paid rent by giving an envelope of cash with no other details?<br><\/p><p>Your landlord or landlady would get a building\u2019s worth of tenants all sending them envelopes of cash without any real way of being able to verify it\u2019s from you, or any of their tenants. Yikes! What a mess.<br><\/p><p>When you use JSON web tokens, it\u2019s like handing over a cheque to pay rent instead of an unmarked envelope of cash \u2013 your identity can be confidently authorized, and the process of paying rent can be completed.<br><\/p><p>With JSON web tokens, your identity is unequivocally verified, and you\u2019re able to continue browsing the website or app where you logged in.<br><\/p><p>It may also be important to note that a JSON web token consists of three main parts that are separated by periods: A header, payload, and signature.<br><\/p><p>For full details, check out <a href=\"https:\/\/jwt.io\/introduction\/\">Introduction to JSON Web Tokens<\/a>.<\/p><figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"350\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-token.png\" alt=\"A JSON web token consists of three main parts that are separated by periods: header, payload, and signature.\" class=\"wp-image-1203610\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-token.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-token-300x131.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-token-768x336.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><h2 class=\"wp-block-heading\" id=\"docs-internal-guid-70f91b33-7fff-bd49-a69d-0d2f8d541d94\">Differences Between JSON Web Tokens and Session Cookies<\/h2><p>Both JSON web tokens and session cookies offer secure forms of user authentication, which is great. But, how do they differ?<br><\/p><p>Detailed below are the specific and main differences between them.<\/p><h3 class=\"wp-block-heading\">1. Cryptographic Signatures<\/h3><p>JSON web tokens have cryptographic signatures, and that\u2019s not the case with session cookies.<\/p><h3 class=\"wp-block-heading\">2. JSON is Stateless<\/h3><p>JSON web tokens are stateless because claims are stored client-side, rather than in the server\u2019s memory.<br><\/p><p>Authentication can occur locally, instead of per request, where requests have to go through the server\u2019s database, or similar locations. This means that a user can be authenticated multiple times without having to communicate with the site or app\u2019s database, and without using up a lot of its resources in the process.<\/p><h3 class=\"wp-block-heading\">3. Scalability<\/h3><p>Because session cookies are stored in the server\u2019s memory, it has the potential of using a lot more resources if the website or app sees a lot of traffic. Because JSON web tokens are stateless, they can potentially save on server resources in many cases.<br><\/p><p>This also means that JSON web tokens tend to be a lot more scalable as a result.<\/p><h3 class=\"wp-block-heading\">4. Authentication Across Multiple Locations<\/h3><p>Session cookies only work across a single domain, or on its subdomains. If they try to go to a third party, browsers tend to disable them. This is particularly an issue if you want your website to have a secure connection with an API that uses a different domain.<br><\/p><p>With JSON web tokens, you can authenticate a user across multiple locations including multiple domains, mobile devices, and APIs to name a few. This is because they\u2019re stored locally in the request header.<\/p><h3 class=\"wp-block-heading\">Which Should You Use?<\/h3><p>While JSON web tokens and session cookies are both viable options, sometimes you may want to use one over the other.<br><\/p><p>For small to medium websites that just need to log a user in and access a few details that are stored in your site\u2019s database, session cookies are usually enough.<br><\/p><p>If you have an enterprise level site, app, or close to it, and you need to handle a lot of requests, especially with third parties, or a lot of third parties, including APIs at a different domain, JSON web tokens are more suitable.<br><\/p><p>Keep in mind that these are general recommendations since each website is different, and has its own specific needs. This should give you a head start on what you may want to use in your case.<\/p><div id=\"om-ulrdquoprwqcywqbbgci-holder\"><\/div>\n\t<script>(function (d, u, ac) {\n\t\t\tvar s = d.createElement('script')\n\t\t\ts.type = 'text\/javascript'\n\t\t\ts.src = 'https:\/\/a.omappapi.com\/app\/js\/api.min.js'\n\t\t\ts.async = true\n\t\t\ts.dataset.user = u\n\t\t\ts.dataset.campaign = ac\n\t\t\td.getElementsByTagName('head')[0].appendChild(s)\n\t\t})(document, 20440, 'ulrdquoprwqcywqbbgci')<\/script><h2 class=\"wp-block-heading\">Wrapping Up<\/h2><p>JSON web tokens and session cookies both offer secure user authentication, but they have key differences between them that make them suitable in varying situations.<br><\/p><p>But now, you have a basic understanding of their main differences so you can decide on how you should move forward for your particular situation.<br><\/p><p><em>Have you decided on using JSON web tokens, or session cookies for your project? Are there some areas where you are still unclear of the differences between them? Feel free to share your thoughts in the comments below.<\/em><\/p>","protected":false},"excerpt":{"rendered":"<p>JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! In this post we explain why they\u2019re actually super different.<\/p>\n","protected":false},"author":43576,"featured_media":1203605,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"kia_subtitle":"","footnotes":""},"categories":[63],"tags":[],"class_list":["post-1203509","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-cache"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JSON Web Tokens vs. Session Cookies: What&#039;s the Difference?<\/title>\n<meta name=\"description\" content=\"JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! Here\u2019s why they\u2019re actually super different.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSON Web Tokens vs. Session Cookies: What&#039;s the Difference?\" \/>\n<meta property=\"og:description\" content=\"JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! Here\u2019s why they\u2019re actually super different.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-21T09:11:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-29T08:04:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"460\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jenni McKinnon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jenni McKinnon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\"},\"author\":{\"name\":\"Jenni McKinnon\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/c424c8db717ce33f9f70867f0a962ac2\"},\"headline\":\"JSON Web Tokens vs. Session Cookies: What&#8217;s the Difference?\",\"datePublished\":\"2019-05-21T09:11:56+00:00\",\"dateModified\":\"2021-07-29T08:04:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\"},\"wordCount\":1418,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png\",\"articleSection\":[\"Page speed and caching\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\",\"url\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\",\"name\":\"JSON Web Tokens vs. Session Cookies: What's the Difference?\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png\",\"datePublished\":\"2019-05-21T09:11:56+00:00\",\"dateModified\":\"2021-07-29T08:04:16+00:00\",\"description\":\"JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! Here\u2019s why they\u2019re actually super different.\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png\",\"width\":1100,\"height\":460,\"caption\":\"Differences Between JSON Web Tokens and Session Cookies\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Page speed and caching\",\"item\":\"https:\/\/wp-rocket.me\/blog\/wordpress-cache\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JSON Web Tokens vs. Session Cookies: What&#8217;s the Difference?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/c424c8db717ce33f9f70867f0a962ac2\",\"name\":\"Jenni McKinnon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1a368446f4bf1880c0e5a8cb742aed12?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1a368446f4bf1880c0e5a8cb742aed12?s=96&d=mm&r=g\",\"caption\":\"Jenni McKinnon\"},\"description\":\"A copywriter, copy editor, web developer, consultant, course instructor and founder of WP Pros(e), Jenni McKinnon has spent the past 15 years developing websites and almost as long for WordPress. A self-described WordPress nerd, she enjoys watching The Simpsons and names her test sites after references from the show.\",\"sameAs\":[\"https:\/\/wpprose.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JSON Web Tokens vs. Session Cookies: What's the Difference?","description":"JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! Here\u2019s why they\u2019re actually super different.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/","og_locale":"en_US","og_type":"article","og_title":"JSON Web Tokens vs. Session Cookies: What's the Difference?","og_description":"JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! Here\u2019s why they\u2019re actually super different.","og_url":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_published_time":"2019-05-21T09:11:56+00:00","article_modified_time":"2021-07-29T08:04:16+00:00","og_image":[{"width":1100,"height":460,"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png","type":"image\/png"}],"author":"Jenni McKinnon","twitter_card":"summary_large_image","twitter_creator":"@wp_rocket","twitter_site":"@wp_rocket","twitter_misc":{"Written by":"Jenni McKinnon","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#article","isPartOf":{"@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/"},"author":{"name":"Jenni McKinnon","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/c424c8db717ce33f9f70867f0a962ac2"},"headline":"JSON Web Tokens vs. Session Cookies: What&#8217;s the Difference?","datePublished":"2019-05-21T09:11:56+00:00","dateModified":"2021-07-29T08:04:16+00:00","mainEntityOfPage":{"@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/"},"wordCount":1418,"commentCount":3,"publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"image":{"@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png","articleSection":["Page speed and caching"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/","url":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/","name":"JSON Web Tokens vs. Session Cookies: What's the Difference?","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png","datePublished":"2019-05-21T09:11:56+00:00","dateModified":"2021-07-29T08:04:16+00:00","description":"JSON Web Tokens and session cookies both offer user authentication so they\u2019re the same, right? Nope! Here\u2019s why they\u2019re actually super different.","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wp-rocket-json-web-tokens-vs-session-cookies.png","width":1100,"height":460,"caption":"Differences Between JSON Web Tokens and Session Cookies"},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/blog\/difference-json-web-tokens-vs-session-cookies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"Page speed and caching","item":"https:\/\/wp-rocket.me\/blog\/wordpress-cache\/"},{"@type":"ListItem","position":3,"name":"JSON Web Tokens vs. Session Cookies: What&#8217;s the Difference?"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]},{"@type":"Person","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/c424c8db717ce33f9f70867f0a962ac2","name":"Jenni McKinnon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1a368446f4bf1880c0e5a8cb742aed12?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1a368446f4bf1880c0e5a8cb742aed12?s=96&d=mm&r=g","caption":"Jenni McKinnon"},"description":"A copywriter, copy editor, web developer, consultant, course instructor and founder of WP Pros(e), Jenni McKinnon has spent the past 15 years developing websites and almost as long for WordPress. A self-described WordPress nerd, she enjoys watching The Simpsons and names her test sites after references from the show.","sameAs":["https:\/\/wpprose.com"]}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts\/1203509"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/users\/43576"}],"replies":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/comments?post=1203509"}],"version-history":[{"count":0,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts\/1203509\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media\/1203605"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=1203509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/categories?post=1203509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/tags?post=1203509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}