php - CURL request & Response redirecting to Page -


i ask opinion or ideas if encountered scenario. 1.) user send curl request http://mycurl_url.com/get_request 2.) get_request function access through rest api. 3.) get_request function validates request redirects them external site www.external_site.com/receive_redirect_response_value

for coding here sample client requesting curl:

$curl = curl_init('http://mycurl_url.com/get_request'); curl_setopt($curl, curlopt_followlocation, true); curl_setopt($curl, curlopt_customrequest, "post"); ...  // rest api key submitted here curl_exec($curl); 

then on mycurl_url.com/get_request here's code

$has_access = has_accessed($_get['key']); if ($has_access) {    header('location: www.external_site.com/receive_redirect_response_value?value=this_is_the_value'); }  return false; 

now idea here user curl request , if he's allowed redirected external site "properly". quoted word "properly" since based on experienced it's redirecting expected problem upon redirection "external site" has no capability of storing session. seems been in stateless form first request when curl restful api request.

can give me idea on how achieve redirection not inherit "stateless" form upon redirection external site?

hope able make question clearly. again


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -