Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why does my session end after redirect during OAuth2 authorization?

Hello,

 

I'm using the Authorization Code Grant Flow to gain access to user data, but after logging into my webpage and creating a new php session, when I click my button to go to the Fitbit authorization page and click the Allow button I get redirected back to my site where my session has ended and I'm logged out.  If I navigate away from my page manually and then come back, the session stays active and I remain logged in -- I'm not sure what's causing my session to end during authentication, does anyone have any ideas?

 

Thank you!

Best Answer
0 Votes
3 REPLIES 3

After investigating further, I've discovered that my session that was started when I logged into my website doesn't end after all.  Instead of continuing my session, though, a new session is created and used instead of the old session which still exits on the server.  This makes me think that the issue might be with my php instead of the OAuth2 process.  I'm going to go down that road and see where it leads.

Best Answer
0 Votes

Yep that was the problem -- I was creating a new session accidentally when I clicked my 'connect to fitbit' button.  Fixed it by including my session manager script at the top of my fitbit authentication script.

Best Answer
0 Votes

Hi @jmather,

 

Welcome to the forums!

 

I'm glad to see you that you were able to figure it out on your own. Please let me know if you have any other questions and I'll be happy to assist.

Best Answer
0 Votes