Actually I am working on Steam trade offer functionality, in which I am getting a problem. I have downloaded the Steam class library and implement it in Codeigniter. I am following the setup guide from https://github.com/halipso/php-steam-tradeoffers#setupsessionid-cookies this. Actually I don't know about session id and cookie:
$steam->setup('sessionID', 'cookies');
What will be sessionID
and cookies
?
I have read about it but did not get any solution. How can I get and implement it in my code?
Go to 'Inventory' -> 'Trade offers' -> 'Who can send me offers?' Here you will find the following box contains a sharable URL. Show activity on this post. If you're looking to use Steam to trade (instead of going inside TF2) then you will need to add them as friends.
It means that if the steam guard wasn't active for the profile from the previous 15 days, they won't be able to trade. Recent Activities: If the user has recently changed their password, trading will be disabled for at least 5 days and the user will have to wait for this period before trading is enabled again.
You send a trade offer to non-friends in the same way that you send trade offers to friends. The difference is that you will need to include your unique Steam trading ID. You can access this by heading to the Steam Trading Privacy page. With this ID, anyone can send you a trading offer as long as they include it.
How to send a Trade Offer to a Non-Firend on Steam You send a trade offer to non-friends in the same way that you send trade offers to friends. The difference is that you will need to include your unique Steam trading ID. You can access this by heading to the Steam Trading Privacy page.
Look at the left-hand menu of any page and click the Trade option. The Trade page will show you the list of pending, completed, and inactive trade offers you’d like to see in the Trade Type pull-down menu.
It would be much more conveniant than having to add someone while they're offline, waiting for them to go online and accept your request, then creating the trade offer. This would also be good since some people have too many friends on their list to accept any more invites.
Well if this is on Laravel you can send _token
which call as csrf_field
by them.
In CI you can do like this. (csrf
generate unique session id)
Path - application/config/config.php
$config['csrf_protection'] = TRUE;
In Login form, you can add this or in page initialize you can add this
$csrf = array(
'name' => $this->security->get_csrf_token_name(),
'hash' => $this->security->get_csrf_hash()
);
<input type="hidden" name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" />
So when saving you can add this to the session. BTW this token can use for cookie as well.
Read this 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
Its better to se this false
,(due to this Tokens may be either regenerated on every submission (default))
$config['csrf_regenerate'] = FALSE;
The session ID is the UUID of Steam which corresponds to our Steam profile. The cookies are there to keep you authenticate.
Here's an example how you can get the sessionID and the cookies : https://github.com/SzymonLisowiec/php-steamlogin (not my repo, credit to SzymonLisowiec)
First of all the documentation at doc says that you only need a API KEY in order to send the requests and calls to endpoint, for the class library you are using have helped you from going into your account and getting API KEY yourself.
so by examining class SteamTrade would explain setup(sessionId, cookies):
Note: all calls done with this format no need for SessionID and Cookies only if not provide API KEY.
http://api.steampowered.com/interface-name/method-name/version/?key=apikey&format=format.
Screenshot:
show how to grab sessionid and cookies with firefox inspector cookies tab
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With