I want to logout the asp.net page using PHP curl, I've that .net page logout URL. Then i tried the below PHP code for logout.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $logoutUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
$curl_errno = curl_errno($ch);
if($curl_errno){
     echo $curl_errno;
}
curl_close($ch);

But it's not working, when i hit the logout URL in browser, the logout is working.

What is the best way to logout the .net page URL(https://hostname/logout.aspx) thanks in advance for you better support and idea

Related posts

Recent Viewed