简体   繁体   English

在Codeigniter中提交表单后更改csrf令牌

[英]change csrf token after form submission in codeigniter

in my config file i have the following csrf setting: 在我的配置文件中,我具有以下csrf设置:

$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();

problem with that is after form submission the session doesn't get deleted.If the session doesn't get destroyed after form submission ,it will create a security risk.I mean that's how it should work that i submit a form and after form submission the token gets deleted from session. 问题是提交表单后会话不会被删除。如果在提交表单后会话没有被破坏,则会造成安全风险。我的意思是这就是我提交表单以及提交表单后应该如何工作令牌将从会话中删除。

How i can solve this issue? 我该如何解决这个问题?

$config['csrf_regenerate'] = FALSE;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM