RSSAmplifier

moomou · Aug 13, 2022

CORS with Cookie

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.


 Introduction
 # 
 
 CORS stands for Cross-Origin-Resource-Sharing and is the HTTP mechanism to
allow servers to accept requests from other host locations other than its own. 
 Getting CORS up and running is not difficult. There are plenty of posts online that will
recommend a starting configuration that looks something like this, in pseudo code 
…

Introduction #

CORS stands for Cross-Origin-Resource-Sharing and is the HTTP mechanism to allow servers to accept requests from other host locations other than its own.

Getting CORS up and running is not difficult. There are plenty of posts online that will recommend a starting configuration that looks something like this, in pseudo code

Header().Set("Access-Control-Allow-Origin", "*")
Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Authorization")

This configuration works great and is the default I use; however, it does not work if you need to receive and set cookies in the browser. This short blog post documents what I learnt about working with cookies with CORS.

Read on /posts/2022-08-13-cors-with-cookie/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.