WebFaction
Community site: login faq

I'm making my first use of the API, and development testing requires frequent logins. Every login RPC returns the same session id, and when I use that id in an immediately subsequent call, the session is expired. Should login ever give me the same session id twice? Should an expired id ever be returned?

From "login" response:

    ["id"]=>
    object(xmlrpcval)#13 (3) {
     ["me"]=>
     array(1) {
      ["int"]=>
      int(53512)
     }
 
From list_disk_usage response:
    ["errstr"]=>
    string(71) ":Expired session: 53512"

asked 15 Jun '15, 08:58

bvbb
11616
accept rate: 0%

edited 15 Jun '15, 12:01


The API login method will never return an expired session id.

The problem is that you're grabbing the wrong value from the result of the login method.

The login method returns two values:

  • session id
  • A structure of key-value pairs consisting of the following information regarding your account:
    • numeric account id
    • username
    • home
    • web_server
    • mail_server

The "53512" value in your response examples above are your numeric account ID.

So, check your code and make sure you grab the first value from the result of the login method (the session id string) and not the second (the key-value structure).

Hope that helps!

permanent link

answered 15 Jun '15, 15:37

seanf
12.2k42136
accept rate: 37%

Thanks. I missed the doc distinction between session id and account id. It would be helpful if the RPC return schemas were more formally described in the doc. The partial narrative style used now can be confusing to new users. Another suggestion: consider including an extension with an XMLRPC client, such as PEAR XML_RPC2, in your standard PHP config.

(16 Jun '15, 12:26) bvbb

@bvbb Can you please reply with a comment to let me know the exact sort of description you'd prefer?

(16 Jun '15, 15:11) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×76
×40
×5
×2
×1

question asked: 15 Jun '15, 08:58

question was seen: 2,189 times

last updated: 16 Jun '15, 15:12

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM