我一直在用谷歌搜索这个并在stackoverflow上寻找答案,但没有找到任何适合我的东西。
我已经在下面检查了!用户可能禁用了 cookie,我已经尝试过这个,并且在多个浏览器中出现了同样的问题。
我正在使用 facebook sdk 进行第三方登录,但是我运行代码的所有内容都得到以下信息
The webpage at https://www.facebook.com/login.php?api_key=466044326753518&cancel_url=http%3A%2F%2Fexample.users36.interdns.co.uk%2Fconnect_facebook&display=page&fbconnect=1&next=http%3A%2F%2Fexample.users36.interdns.co.uk%2Fconnect_facebook&return_session=1&session_version=3&v=1.0&req_perms=user_birthday has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
这是它为 url 生成的 url
https://www.facebook.com/login.php?api_key=466044326753518&cancel_url=http%3A%2F%2Fexample.users36.interdns.co.uk%2Fconnect_facebook&display=page&fbconnect=1&next=http%3A%2F%2Fexample.users36.interdns.co.uk%2Fconnect_facebook&return_session=1&session_version=3&v=1.0&req_perms=user_birthday
我尝试了很多选择,但似乎没有任何效果。我正在使用 codeigniter,我将 uri_protocol 设置为 auto
$config['uri_protocol'] = 'AUTO';
如果我将它设置为 PATH_INFO 它可以工作
$config['uri_protocol'] = 'PATH_INFO';
这让我发疯,因为这意味着我必须将我所有的网址都保留在 index.php 中,这是我的 .htaccess
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
<Files "index.php">
AcceptPathInfo On
</Files>
我读到我的主机可能不支持 path_info?
任何人都可以对此有所了解,我也将联系我的托管。
谢谢
更新它是从 chrome 中的网络选项卡在这两个 url 之间重定向。
http://example.users36.interdns.co.uk/connect_facebook?session=%7B%22session_key%22%3A%222.AQDZt8rGtuhgss40.3600.1345111200.0-680410999%22%2C%22uid%22%3A%22680410999%22%2C%22expires%22%3A1345111200%2C%22secret%22%3A%22CCHtz17wmFCRRNApLUM6zQ__%22%2C%22base_domain%22%3A%22http%3A%5C%2F%5C%2Fexample.users36.interdns.co.uk%5C%2F%22%2C%22access_token%22%3A%22AAAGn3WaLtO4BAFA8HOMbdJY1ouKwIZCIfOxHqnJEjU2beEkARUeQIJ24J3Qsw93UWJSPJF7qGorkBXWeaP0TlBV2UKWuBvrjqIn2jJgZDZD%22%2C%22sig%22%3A%220e7a4c9d172006abc642756617cbe058%22%7D
https://www.facebook.com/login.php?api_key=466044326753518&cancel_url=http%3A%2F%2Fexample.users36.interdns.co.uk%2Fconnect_facebook&display=page&fbconnect=1&next=http%3A%2F%2Fexample.users36.interdns.co.uk%2Fconnect_facebook&return_session=1&session_version=3&v=1.0&req_perms=user_birthday
当我将其设置为 path_info 时,它可以工作,这是网络响应
https://www.facebook.com/login.php?api_key=466044326753518&cancel_url=http%3A%2F%2Fexample.users36.interdns.co.uk%2Findex.php%2Fconnect_facebook&display=page&fbconnect=1&next=http%3A%2F%2Fexample.users36.interdns.co.uk%2Findex.php%2Fconnect_facebook&return_session=1&session_version=3&v=1.0&req_perms=user_birthday
http://example.users36.interdns.co.uk/index.php/connect_facebook?session=%7B%22session_key%22%3A%222.AQDZt8rGtuhgss40.3600.1345111200.0-680410999%22%2C%22uid%22%3A%22680410999%22%2C%22expires%22%3A1345111200%2C%22secret%22%3A%22CCHtz17wmFCRRNApLUM6zQ__%22%2C%22base_domain%22%3A%22http%3A%5C%2F%5C%2Fexample.users36.interdns.co.uk%5C%2F%22%2C%22access_token%22%3A%22AAAGn3WaLtO4BAFA8HOMbdJY1ouKwIZCIfOxHqnJEjU2beEkARUeQIJ24J3Qsw93UWJSPJF7qGorkBXWeaP0TlBV2UKWuBvrjqIn2jJgZDZD%22%2C%22sig%22%3A%220e7a4c9d172006abc642756617cbe058%22%7D