实际上我正在研究Steam交易提供功能,我遇到了问题.我已下载Steam类库并在Codeigniter中实现它.我正在按照
https://github.com/halipso/php-steam-tradeoffers#setupsessionid-cookies的设置指南进行操作.实际上我不知道会话ID和cookie:
$steam->setup('sessionID','cookies');
什么是sessionID和cookies?
好吧,如果这是在Laravel你可以发送_token,由他们调用csrf_field.
原文链接:https://www.f2er.com/php/240037.html在CI中你可以这样做. (csrf生成唯一的会话ID)
路径 – application / config / config.PHP
$config['csrf_protection'] = TRUE;
$csrf = array( 'name' => $this->security->get_csrf_token_name(),'hash' => $this->security->get_csrf_hash() ); <input type="hidden" name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" />
因此,在保存时,您可以将其添加到会话中. BTW此令牌也可用于cookie.
阅读本Cross-site request forgery (CSRF)
Tokens may be either regenerated on every submission (default) or kept the same throughout the life of the CSRF cookie. The default regeneration of tokens provides stricter security,but may result in usability concerns as other tokens become invalid (back/forward navigation,multiple tabs/windows,asynchronous actions,etc). You may alter this behavior by editing the following config parameter
Source Codeigniter documentation
最好是这个假,(由于这个标记可能会在每次提交时重新生成(默认))
$config['csrf_regenerate'] = FALSE;