久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在兩個不同的域中使用 cookie?

How do I use cookies across two different domains?(如何在兩個不同的域中使用 cookie?)
本文介紹了如何在兩個不同的域中使用 cookie?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我需要使用 cookie 在兩個不同的域之間共享 SSO 信息,這可以在 PHP 中實現嗎?如何實現?

I need to share SSO information between two different domains with a cookie, can this be done in PHP and how?

推薦答案

在兩個域上,放置從另一個域中提取的圖像或其他 Web 元素.使用 URL 通知其他域用戶 X 在域 A 上,并讓域 B 將該用戶 ID 與其系統上的該用戶相關聯.

On both domains, place an image or other web element that is pulled from the other domain. Use the URL to notify the other domain that user X is on domain A, and let domain B associate that user ID with that user on their system.

正確執行有點復雜,但如果你仔細考慮它會很有效.

It's a little complex to carry out correctly, but if you think it through it'll work out very well.

Vinko 在評論中指出(謝謝!)我不應該認為您了解所涉及的安全風險是理所當然的.如果此信息對任何人都有價值,那么您應該確保使用適當的加密、身份驗證等,以避免發布敏感信息并避免各種攻擊(重播、中間人等).這應該不會太麻煩,因為您可以控制兩個網站,并且可以為這兩個網站選擇一個安全的密鑰,因為通信僅通過這個特殊的 URL 在兩個服務器之間進行.不過請記住.

Vinko points out in a comment (thanks!) that I shouldn't take it for granted that you understand the security risks involved. If this information is of any value to anyone, then you should make sure you use proper encryption, authentication, etc to avoid releasing sensitive information and to avoid various attacks (replay, man in the middle, etc). This shouldn't be too onerous since you control both websites and you can select a secure secret key for both, since the communication is only going between the two servers via this special URL. Keep it in mind though.

-亞當

這篇關于如何在兩個不同的域中使用 cookie?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 成人精品一区 | 亚洲品质自拍视频网站 | www.亚洲成人网 | 国产视频福利一区 | 天堂色区 | 欧美日韩中文在线 | 涩涩视频在线观看 | 成人不卡 | 欧美片网站免费 | 中文字幕丁香5月 | 一级大片免费 | 中文字幕在线免费观看 | 中文区中文字幕免费看 | 免费亚洲成人 | 午夜精品一区二区三区在线 | 欧美精品91| 理论片午午伦夜理片影院 | 久久久久久久久久久久久9999 | 韩日一区二区三区 | 特级做a爰片毛片免费看108 | 精品国产一区久久 | 欧美一区免费 | 欧美一二三 | 精品欧美一区二区三区久久久 | 一区二区在线不卡 | 成年男女免费视频网站 | 亚洲欧美日韩国产综合 | 久久a久久| 国产精品欧美一区二区三区不卡 | 日韩高清在线观看 | 啪啪av | 俺去俺来也www色官网cms | 欧美激情va永久在线播放 | 黄色片大全在线观看 | 中文字幕不卡在线观看 | 日韩免费在线观看视频 | 日韩精品成人网 | 五月免费视频 | 亚洲欧美综合 | 欧美日韩专区 | 欧美日韩专区 |