PHP Classes

Multiple cookie values?

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  PHP OAuth Tutorial on...  >  All threads  >  Multiple cookie values?  >  (Un) Subscribe thread alerts  
Subject:Multiple cookie values?
Summary:Cookie value for multiple platforms
Messages:2
Author:Steve Esemplare
Date:2017-05-10 13:26:54
 

  1. Multiple cookie values?   Reply   Report abuse  
Picture of Steve Esemplare Steve Esemplare - 2017-05-10 13:26:54
I am running into an issue with using the classes (they are EXCELLENT BTW), where it looks like the cookie value for a session is overwritten resulting in new sessions, thus losing the auth token from a previous call.

As an example, I want to be able to get an access token from Pinterest and Dropbox on Page A, then on Page B make a call to both to retrieve user info.

1. If I auth to Pinterest on Page A, then go to Page B to get the user info - it works perfectly. Cookie is set to the session correctly.

2. Then I clear the auth.

3. If I auth to Dropbox on Page A, then go to Page B to get the user info - it works perfectly. Cookie is set to the session correctly.

4. Then I clear the auth.

5. If I auth Pinterest on Page A, then auth to Drop Box on Page, when I go to Page B to retrieve the user info, new sessions (and cookie value) are created and the access token is now blank.

It looks to me like the session is being pulled from the cookie, I could see if the cookie supports multiple values. Can you provide some guidance?

  2. Re: Multiple cookie values?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-05-15 07:04:05 - In reply to message 1 from Steve Esemplare
I am not sure if you are using sessions which is the default of base OAuth client class, or you are using the cookie oauth class.

If you are using the cookie oauth client class, you need to change the cookie_name variable for each of the APIs.

If you use the regular OAuth client class, it uses session array variables that have different entries for each API.