Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I send trade offer

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?

like image 973
Indresh Tayal Avatar asked Nov 09 '17 07:11

Indresh Tayal


People also ask

How do I send a trade offer to a non friend on Steam?

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.

Why can't I send trade offers on Steam?

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.

How do I send a trade offer to a non-friend?

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?

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.

How do I See my available trade offers?

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.

Is it possible to add someone to a trade offer?

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.


3 Answers

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


If it's not in a login page, then

Its better to se this false,(due to this Tokens may be either regenerated on every submission (default))

$config['csrf_regenerate'] = FALSE;
like image 60
Abdulla Nilam Avatar answered Oct 21 '22 18:10

Abdulla Nilam


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)

like image 2
Clément Baconnier Avatar answered Oct 21 '22 17:10

Clément Baconnier


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):

  1. if have API KEY then I don't need Cookies and SessionID stop else go step 2.
  2. get API KEY but you should provide me with Cookies and sessionid in order for me to login and accept agreement and register your account as developer account go step 1 else show error .


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

sessionid screenshot

like image 2
sdx11 Avatar answered Oct 21 '22 18:10

sdx11