flag:一個(gè) TRUE/FALSE 值,表明給定域中的所有機(jī)器是否都可以訪問該變量。此值由瀏覽器自動(dòng)設(shè)置,具體取決于你為域設(shè)置的值。
path:變量在域中有效的路徑。
secure:一個(gè) TRUE/FALSE 值,表明是否需要與域的安全連接來(lái)訪問變量。
expiration:該變量將過期的UNIX時(shí)間。UNIX時(shí)間定義為自1970年1月1日00:00:00 GMT開始的秒數(shù)。
name:變量名稱
value:變量值
校驗(yàn)是否登錄成功
直接訪問和帶有cookie訪問,這兩種訪問方式,請(qǐng)對(duì)比查看。
直接訪問
[root@iZ28xbsfvc4Z 20190714_02]# curl -i https://leancloud.cn/1.1/clients/self/apps
HTTP/1.1 403 Forbidden
Server: openresty
Date: Sun, 14 Jul 2019 11:52:47 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache,no-store
Pragma: no-cache
{code:1,error:User doesn\\\'t sign in.}
帶有cookie文件的訪問
# 使用cookie
[root@iZ28xbsfvc4Z 20190714_02]# curl -i -b leancloud1.info https://leancloud.cn/1.1/clients/self/apps
## 或者
[root@iZ28xbsfvc4Z 20190714_02]# curl -i -b leancloud3.info https://leancloud.cn/1.1/clients/self/apps
HTTP/1.1 200 OK
Server: openresty
Date: Sun, 14 Jul 2019 11:53:29 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache,no-store
Pragma: no-cache
Strict-Transport-Security: max-age=31536000
[{app_domain:null,description:null,archive_status:0,biz_type:dev,master_key: ………………
復(fù)制瀏覽器的cookie訪問
[root@iZ28xbsfvc4Z 20190720]# curl -i -H \\\'cookie: _ga=GA1.2.2055706705.1560005524; …………\\\' https://leancloud.cn/1.1/clients/self/apps
HTTP/1.1 200 OK
Server: openresty
Date: Sat, 20 Jul 2019 08:11:37 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache,no-store
Pragma: no-cache
Strict-Transport-Security: max-age=31536000
[{app_domain:null,description:null,archive_status:0,biz_type:dev,master_key: ………………
由上可知curl登錄成功。
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)三五互聯(lián)的支持。
更多關(guān)于云服務(wù)器,域名注冊(cè),虛擬主機(jī)的問題,請(qǐng)?jiān)L問三五互聯(lián)官網(wǎng):m.shinetop.cn