# Issues with invalid CSRF

**URL:** <https://forum.elixirforum.com/t/issues-with-invalid-csrf/30778>\
**Category:** Questions\
**Tags:** phoenix, troubleshooting, csrf\
**Created:** [April 20, 2020, 11:10am UTC](https://forum.elixirforum.com/t/issues-with-invalid-csrf/30778 "2020-04-20T11:10:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregori](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gregori](https://forum.elixirforum.com/u/gregori)\
**Post date:** [April 20, 2020, 11:10am UTC](https://forum.elixirforum.com/t/issues-with-invalid-csrf/30778/1 "2020-04-20T11:10:40Z")

</div>

So I have been developing this app. Everything goes well. Then I enable SSL (phoenix internal certs). It works. I enabled the server to work http on 4000 and https on 4001.  
When I try to login to http it works (and logout), then I try to login to https, it works. Then I try to login to http again, and I get a CSRF error.  
I checked csrf token is ok, and it is passed to login form post fine.  
Why do I get this error?
