Welcome Guest, Not a member yet? Register   Sign In
CSRF and double posting
#1

(This post was last modified: 06-18-2016, 11:09 PM by PaulD. Edit Reason: Added clarification )

Hi,

I have the latest CI and CSRF is enabled and working. But I noticed that if I double click really, really quickly, on the submit button, I can still post twice. In this case I am submitting to a controller that, upon success, redirects and refreshes to another controller. I thought, because the CSRF was regenerated, the second submit would not work.

To prevent this, because it is annoying me now, do I have to resort to some javascript to prevent the double click?

Just in case I am doing something wrong (although I am pretty sure I am not), here is my CSRF config:
PHP Code:
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrfbpbtok';
$config['csrf_cookie_name'] = 'csrfbpb';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array(); 

And the form is outputting the CSRF code:
Code:
<form action="...my url..." method="post" accept-charset="utf-8">
<input type="hidden" name="csrfbpbtok" value="19ac6f0516d5e63e665f3a59bf350f99" style="display:none;" />

Am I just tired and doing something daft? Or is the very quick double click a separate issue entirely? After all, the CSRF stops other people faking posts, not double clicks. But shouldn't the regenerated token prevent it?

Thanks in advance,

Paul.
Reply


Messages In This Thread
CSRF and double posting - by PaulD - 06-18-2016, 11:03 PM
RE: CSRF and double posting - by skunkbad - 06-19-2016, 12:05 AM
RE: CSRF and double posting - by John_Betong - 06-20-2016, 09:25 PM
RE: CSRF and double posting - by skunkbad - 06-20-2016, 10:55 PM
RE: CSRF and double posting - by PaulD - 06-19-2016, 12:43 AM
RE: CSRF and double posting - by PaulD - 06-19-2016, 01:00 AM
RE: CSRF and double posting - by PaulD - 06-19-2016, 03:19 AM
RE: CSRF and double posting - by skunkbad - 06-19-2016, 09:30 AM
RE: CSRF and double posting - by PaulD - 06-19-2016, 03:06 PM
RE: CSRF and double posting - by skunkbad - 06-19-2016, 03:35 PM
RE: CSRF and double posting - by PaulD - 06-19-2016, 05:59 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 11:18 AM
RE: CSRF and double posting - by Narf - 06-20-2016, 12:26 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 12:37 PM
RE: CSRF and double posting - by Narf - 06-20-2016, 01:49 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 02:32 PM
RE: CSRF and double posting - by PaulD - 06-20-2016, 01:46 PM
RE: CSRF and double posting - by PaulD - 06-20-2016, 04:02 PM
RE: CSRF and double posting - by spjonez - 06-20-2016, 07:00 PM
RE: CSRF and double posting - by Narf - 06-21-2016, 03:38 AM
RE: CSRF and double posting - by spjonez - 06-21-2016, 08:54 AM
RE: CSRF and double posting - by Narf - 06-22-2016, 05:14 AM
RE: CSRF and double posting - by Martin7483 - 06-23-2016, 03:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB