×
Menu
Index

Logout

Description

 
Log out of SoftNAS Cloud® and deactivate the API session.
 
GET logout
 

Request

 
 
Example
<?php
 
    $mypath = getcwd();
 
    $mypath = preg_replace('/\\\\/', '/', $mypath);
 
    $cookie_file_path = "$mypath/cookies/cookie.txt";
 
    $ch = curl_init();
 
    curl_setopt($ch, CURLOPT_URL, "https://example.com/softnas/logout.php");
 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE );
 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE );
 
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);   // Cookie management.
 
    curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
 
    curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
 
    $output = curl_exec($ch);
 
    $info = curl_getinfo($ch);
 
    curl_close($ch);
 
    echo $info;
 
?>
 

Return Values

 
 
Example
{
    "result": {},
    "session_id": 8062,
    "success": true
}
Made with help of Dr.Explain
Copyright (c) SoftNAS LLC