加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

php – 如何发送交易报价

发布时间:2020-05-25 09:40:12 所属栏目:PHP 来源:互联网
导读:实际上我正在研究Steam交易提供功能,我遇到了问题.我已下载Steam类库并在Codeigniter中实现它.我正在按照 https://github.com/halipso/php-steam-tradeoffers#setupsessionid-cookies的设置指南进行操作.实际上我不知道会话ID和cookie: $steam-setup(session

实际上我正在研究Steam交易提供功能,我遇到了问题.我已下载Steam类库并在Codeigniter中实现它.我正在按照 https://github.com/halipso/php-steam-tradeoffers#setupsessionid-cookies的设置指南进行操作.实际上我不知道会话ID和cookie:

$steam->setup('sessionID','cookies');

什么是sessionID和cookies?

我已经读过它,但没有得到任何解决方案.如何在我的代码中获取并实现它?

好吧,如果这是在Laravel你可以发送_token,由他们调用csrf_field.

在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;

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读