cnam / security-jwt-service-provider

Silex security jwt service provider (silex 1.x and 2.x version) allow oauth2 header
GNU General Public License v2.0
60 stars 40 forks source link

cookies feature #19

Open serweb-labs opened 8 years ago

serweb-labs commented 8 years ago

Hello Cnam! send the token in a cookie is very efficient in a normal website that wants to be stateless. Cookies are quite safe and once obtained are automatically sent to the server. I would like this feature is implemented.

        //Snippet in Silex\Component\Security\Http\Firewall::handle

        if ($this->options['header_name'] == "Cookie" && $this->options['cookie_name']) {
            $cookie = $request->cookies->get($this->options['cookie_name']);
            $requestToken = $this->getToken($cookie);
        }
        else {
            $requestToken = $this->getToken(
            $request->headers->get($this->options['header_name'], null)
            ); 
        }   

Thank You.