Search code examples
phpapisessioncurllinkedin-api

simple-linkedinphp: Undefined index: oauth


I'm using simple-linkedinphp and OAuth library to connect to LinkedIn. When I run demo.3.0.2.php, connect with LinkedIn and press the blue button "Ok, I'll allow" I get the error:

Notice: Undefined index: oauth on line 136.
LinkedIn->retrieveTokenAccess(): bad data passed, string type is required for $token, $secret and $verifier.

Examining the problem further it seems the session data is lost when LinkedIn returns to the script. cURL does seem to start a new session instead of using the initial session.


Solution

  • The following line in my config file caused the trouble:

    ini_set("session.cookie_domain", ".mywebsite.com");
    

    Commenting this out solved the problem.