U может найти его в реестре.
До версии 6 IIS можно найти его здесь:
HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters
Начиная с версии 7 здесь:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp
MajorVersion MinorVersion
WordPress, похоже, не вызывает session_start ()
, потому что он хочет быть без гражданства
, и если register_globals
определен, он автоматически уничтожает ваш $ _ SESSION
Wordpress, похоже, не использует никаких сеансов.
Лучший способ решить эту проблему - использовать предоставляемые им хуки действий.
For what I need to do, the best answer involves:
My cookies are as follows:
[wordpress_909bb230b32f5f0473202684d863b2e0] => mshaffer|1255298821|d0249fced9c323835c5bf7e84ad3ffea
[wordpress_logged_in_909bb230b32f5f0473202684d863b2e0] => mshaffer|1255298821|56e9c19541ecb596a1fa0995da935700
Using PHP, I can loop over the cookies, parse the key=>value
pairs. These cookies let me know that [mshaffer]
has a cookie stored on wordpress, and also is authenticated as logged_in
. The expiry of the cookie is 1255298821
.
In sub2, I can query the database of wordpress and grab the user info:
SELECT * FROM `wp_users` WHERE user_login = 'mshaffer' ...
grab user_id, user_email from this query
SELECT * FROM `wp_usermeta` WHERE user_id = '$user_id' ...
grab lots of other data from wp
With this info, I can add to my sub2 session variable / cookie and do what I want with the data. I can identify if I am logged in, and my username ... which let's me grab lots of different data. I can now use WordPress authentication in my sub2.domain.com and redirect accordingly.
monte
{x: