This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Handling CORS requests

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 1


1.0.0 2017-07-04 13:12 UTC

This package is auto-updated.

Last update: 2021-09-27 19:21:26 UTC


Handling CORS Requests

Total Downloads


Add composer dependency:

composer.phar require sokil/cors-bundle

Register bundle in your AppKernel:


class AppKernel extends Kernel
    public function registerBundles()
        $bundles = array(
            new Sokil\CorsBundle\CorsBundle(),


Configure bundle in your /app/config/config.yml:

  allowedOrigins: # list of hosts, allowed to do CORS requests to your app. 
  withCredentials: true # allow send cookies to your hosts between requests
  maxAge: 86400 # agte of prefligt request cache


Listener CorsRequestListener is listened to kernel events of requests and add headers if this is CORS request and CORS allowed for that host.