Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

Symfony5 The CSRF token is invalid - after upload on hosting

I have strange problem: i have dev version on pc on localhost and it;s work but after uploading on hosting on every form i have error:

The CSRF token is invalid. Please try to resubmit the form. 

I tryied repload, delete cache and everytime the same error on all forms. I have another application uploaded on the same hosting 2 months ago and everything works fine:

One of my forms:

{% block body %}
    <h1>Formularz Kontaktowy</h1>
    {% form_theme contactForm 'bootstrap_4_layout.html.twig' %}
    {{ form_start(contactForm) }}
    {{ form_row(contactForm.name) }}
    {{ form_row(contactForm.email) }}
    {{ form_row(contactForm.subject) }}
    {{ form_row(contactForm.body) }}
    {{ form_row(contactForm.submit) }}
    {{ form_end(contactForm) }}
{% endblock %}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Problem solved ! i need to type my page adress by https not http !


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...