Skip to content

CSRF cookie is not working for HTTP #651

@misekm

Description

@misekm

Cookie generated by CSRF middleware is containing attribute 'Secure', which means, that cookie can be transferred only by HTTPS. When using strict http client and using HTTP protocol (unsecured), cookie will not be send in following requests.

It would be good to check incoming request for type of protocol and set 'Secure' attribute based on that.
Potentially event X-Forwarded-For headers.

In production it makes sense to use HTTPS, so this issue will not occur often.
But for example for testing, there is no need for HTTPS at all and in such case this is an issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions