Symfony 1.4: Custom error message for CSRF in forms

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-05T12:40:27Z Indexed on 2010/04/05 12:43 UTC
Read the original article Hit count: 630

Filed under:
|
|
|
|

Hi,

Can anyone tell me where/how to customise the CSRF token error message for forms in Symfony 1.4. I'm using sfDoctrineGuard for logins and in this form particularly, whenever a session runs out and you still have the page open, it throws a very user-unfriendly error: "CSRF attack detected". Something like "This session has expired. Please return to the home page and try again" sounds better.

What's the right way to do this in the form class?

Thanks.

© Stack Overflow or respective owner

Related posts about symfony

Related posts about sfguard