Php curl自动身份验证未设置会话

I am using php curl function for auto authentication, and it works fine.But i am not able to go to another page on the same domain and I think session is not set.Help me please,thanks in advance.

You might need to send over the session cookie when going over to the other page to maintain state

See: Maintaining PHP session when using CURL

In order to keep session information, you will need to tell CURL where to store Cookie data. You can do this with the CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR options set with curl_setopt.

EDIT Here's an example:

curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt")

With curl and rest-services you don't have session. So, as a solution your auth operation should return session_id and you should pass that session_id in the next request where request is signed. After that you should implement additional security checks by session_id.

The best way to me is to integrate OAuth2 authentication when you have access_token, expired_in and refresh_token. Refresh_token is optional parameter and you can use it when you try to get new access_token by refresh_token when access_token is expired.