rahultailwal Posted November 8, 2012 Share Posted November 8, 2012 Hi, I have one login page where after login i m saving user_id and password in session variables. in some page i am using an api which takes me to the new page. (like in gmail auth api.) I am using session_start in my all the pages at the top. After call back from the api my session is getting destroyed. If i again try to login and do the same process its working fine. As i checked in my firebug. After first login my session cookie is creating. After coming back from api page to my page a new session started as i have written in my page and it makes a new PHPSESSID and invalidates my previous sesssion. Second time repeating the process it doesnt do same. I want to know what i am doing wrong that it makes a new PHPSESSID. Thanks, Rahul Link to comment Share on other sites More sharing options...
justsomeguy Posted November 8, 2012 Share Posted November 8, 2012 Are you using session_destroy or session_regenerate_id? Is the domain and subdomain the same when it redirects back? Can you see your browser trying to send the session cookie with the old ID? Link to comment Share on other sites More sharing options...
rahultailwal Posted November 9, 2012 Author Share Posted November 9, 2012 (edited) I got the problem and solve it. I send the session_id with the api url and that solved the problem. Previously after coming from api, the callback url was a page i haven't visited and was creating new session. After sending session_id to api url it doesnt make new session and page doesnt redirected. Thanks Edited November 9, 2012 by rahultailwal Link to comment Share on other sites More sharing options...
rahultailwal Posted November 19, 2012 Author Share Posted November 19, 2012 Oh I am again stuck on this problem. I am sending PHPSESSID in my redirect url but its not working in mozilla. And when i test it to other browser it works fine. Dont know what is the problem. I am working with salesforce api. And it might be api fault but. When my application started a session in one page then if after redirecting from api to a new page how this is changing. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 19, 2012 Share Posted November 19, 2012 It's hard for me to answer that, if I was debugging that I would my browser's developer console to look at all of the cookies going back and forth in the requests and responses. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now