Jump to content


Photo
Question

Resuming session using cookies

node.js node-steam-tradeoffer-manager

  • Please log in to reply
5 replies to this topic

#1 romatello

romatello

    Newbie

  • Member
  • Pip
  • 4 posts
  • LocationGomel

Posted 30 May 2018 - 11:37 AM

I've cookies array like this:

[ 
  'sessionid=7030e64a53d6f7860bc69038', 
  'steamLogin=76561198447561491%7c%7c3B5AF02B12EC2F367974917BC090EB7F0E6B3B91', 
  'steamLoginSecure=76561198447561491%7c%7c1CC92BDD67243C7E761681E40E3B8419416AA858' 
]

I get an error "not logged in" when I try to log in trade offer manager through cookies using setCookies method. I take cookies a minute before using setCookies method
Can someone explain why i get an error?



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,817 posts

Posted 30 May 2018 - 12:08 PM

Can you show your code?



#3 romatello

romatello

    Newbie

  • Member
  • Pip
  • 4 posts
  • LocationGomel

Posted 30 May 2018 - 03:11 PM

var cookies = db_data.cookies.split(","); // cookies in db stored as string 
var steam_community = new SteamCommunity();
var offer_manager = new TradeOfferManager({
  "community": steam_community
});

offer_manager.setCookies(cookies, function(err) {
  if (err) {
    console.log(err);
    console.log(cookies);
    return;
  }
  console.log("Got API key: " + offer_manager.apiKey);
});


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,817 posts

Posted 30 May 2018 - 05:15 PM

Are you using the cookies on the same IP as where they were created? I find generally you have to use the same IP.



#5 romatello

romatello

    Newbie

  • Member
  • Pip
  • 4 posts
  • LocationGomel

Posted 30 May 2018 - 06:25 PM

for the test, I use two scripts on the same server. first one writes cookies to db, second one tries to log in trade offer manager using cookies. IP is the same.


Edited by romatello, 30 May 2018 - 06:26 PM.


#6 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,817 posts

Posted 30 May 2018 - 08:01 PM

I dunno what to tell you. Everything you posted looks good, so you must be doing something wrong elsewhere.







Also tagged with one or more of these keywords: Question, node.js, node-steam-tradeoffer-manager

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users