
內容簡介
若您想在網站中整合 WordPress 認證系統至其他腳本中,您可能會遇到認證問題,因為您的程式碼無法讀取 WordPress Cookie。
預設情況下,WordPress Cookie 完全符合您安裝的網址,但這個外掛會從 Cookie 中移除任何子文件夾,讓您的整個網域都可以訪問它。
例如,如果您在 http://www.mydomain.com/wordpress/ 安裝 WordPress,則儲存在 http://www.mydomain.com/mymagiccode/ 中的任何 PHP 都無法讀取 Cookie,原因是瀏覽器安全性。這個外掛會將路徑更改為 http://www.mydomain.com/,因此您網站上的任何 PHP 代碼都可以訪問 Cookie。因此,在上述範例中,http://www.mydomain.com/mymagiccode/checkauthentication.php 會檢查 Cookie,以查看您是否已登入 WordPress。
新增功能: 現在可以允許 Cookie 跨子網域使用!以下是一些範例:
http://www.mydomain.com/
http://test.mydomain.com/
http://www.mydomain.com/blog/
http://test.mydomain.com/new/
http://forum.mydomain.com/getwordpresslogin.php
多博客安裝
您可以使用此外掛,以便當您登入一個 WordPress 网站時,自動登入第二個,但有一些注意事項:
用於驗證的用户名和密码必須在兩個網站上相同!
安全金鑰 https://codex.wordpress.org/Editing_wp-config.php#Security_Keys 必須在兩個網站上相同!
支援
歡迎在我的網站上留言,但請在 此 WordPress 論壇 上發帖。
外掛標籤
開發者團隊
原文外掛簡介
If you want to integrate the wordpress authentication magic into another script within your website you may come across authentication issues because your code cannot read the wordpress cookie.
By default the wordpress cookie exactly matches the URL of your installation, this plugin removes any subfolders from the cookie so that your whole domain has access to it.
For Example if you have wordpress installed in http://www.mydomain.com/wordpress/ any php stored in http://www.mydomain.com/mymagiccode/ cannot see the cookie due to browser security. This plugin changes the path to http://www.mydomain.com/ so that any php code on your site can access the cookie, so in our above example http://www.mydomain.com/mymagiccode/checkauthentication.php can now check the cookie to see if you have logged into wordpress.
NEW: Now you can allow cookies to be used across subdomains! Here are some examples that you can now access cookies from:
http://www.mydomain.com/
http://test.mydomain.com/
http://www.mydomain.com/blog/
http://test.mydomain.com/new/
http://forum.mydomain.com/getwordpresslogin.php
Multi-blog Installs
It is possible to use this plugin such that if you are logged into one WordPress site, then you are auto-magically logged into the second, but there are some caveats!
The Username & Password MUST be the same on Both!
The Security Keys https://codex.wordpress.org/Editing_wp-config.php#Security_Keys Need to be the same on Both!
Support
Comments on my website are welcome, but please post in this WordPress Forum
