php phpmyadmin 无法设置会话 cookie。也许您使用的是 HTTP 而不是 HTTPS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/49811804/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:46:49  来源:igfitidea点击:

phpmyadmin Failed to set session cookie. Maybe you are using HTTP instead of HTTPS

phpphpmyadmin

提问by Lancer

I install PHP, Apache, and MySQL done and worked. When I finish installing Phpmyadmin, then open it has an error.

我安装了 PHP、Apache 和 MySQL,并且工作正常。当我完成安装 Phpmyadmin 时,打开它有一个错误。

Failed to set session cookie. Maybe you are using HTTP instead of HTTPS.

I don't know why. How can I fix this?

我不知道为什么。我怎样才能解决这个问题?

回答by HenryW

After searching the net for a solution to this problem i figured out that in my case a specific chrome extension caused the login problem. So i recommend to disable your extensions .

在网上搜索此问题的解决方案后,我发现在我的情况下,特定的 chrome 扩展程序导致了登录问题。所以我建议禁用您的扩展。

In my case the chrome extension that caused the problem was called : Safe torrent scanner

在我的情况下,导致问题的 chrome 扩展名为:安全种子扫描仪

回答by Elliot

Just had this issue on Chrome today, the following worked for me so I thought I'd share it.

今天刚刚在 Chrome 上遇到了这个问题,以下对我有用,所以我想我会分享它。

Navigate to the Inspector > Application > Clear Storage > Go ahead and clear everything.

导航到检查器 > 应用程序 > 清除存储 > 继续并清除所有内容。

enter image description here

在此处输入图片说明

回答by user972616

I had the same problem and a quick workaround was to use Incognito mode

我遇到了同样的问题,一个快速的解决方法是使用隐身模式

回答by Isaac Bennetch

You don't seem to be the first to experience this; there's one other before you: https://github.com/phpmyadmin/phpmyadmin/issues/14184

您似乎不是第一个体验到这种情况的人;在你之前还有一个:https: //github.com/phpmyadmin/phpmyadmin/issues/14184

I've personally had trouble where I have to press the button to log in a second time, but it works for me. The person who opened that bug was completely unable to log in.

我个人在必须按下按钮才能再次登录时遇到了麻烦,但它对我有用。打开那个bug的人完全无法登录。

So basically it's currently an open and known bug and hopefully it will be fixed for the next phpMyAdmin release.

所以基本上它目前是一个开放和已知的错误,希望它会在下一个 phpMyAdmin 版本中得到修复。

回答by Ewer Ling

I have had this issue in the past however was successful in solving it using the instructions provided in this answer. (using phpMyAdmin version 4.8.0.1)

我过去曾遇到过这个问题,但是使用此答案中提供的说明成功解决了它。(使用 phpMyAdmin 版本 4.8.0.1)

Navigate to

导航

config.inc.php

in your server files and examine the following section:

在您的服务器文件中并检查以下部分:

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

If not already performed, comment outthe user and password lines and makes sure the auth_typeis set to cookie.

如果尚未执行,请注释掉用户和密码行并确保auth_type设置为cookie

From my experience, this action needs to take place for phpMyAdmin to operate with cookie authentication before you move on.

根据我的经验,在继续之前,phpMyAdmin 需要执行此操作才能使用 cookie 身份验证进行操作。

Next perform the following steps to solve the session cookie not working with HTTP:

接下来执行以下步骤来解决会话 cookie 不适用于 HTTP:

  1. Enter your browser settings (e.g. for Google Chrome go to chrome://settings/)
  2. Attempt to locate the setting to clear cookies, cached data, images and files, history, etc.
  3. After you successfully find this, clear your browser's browsing history, download history, cached images and files, and content settings.
  4. Clear the cookies for the phpMyAdmin login page. Note:In Internet Explorer, it is slightly difficult to view and delete the cookies. An internet article is available from Ask Leoabout viewing cookies in IE if you need help.
  1. 输入您的浏览器设置(例如,对于 Google Chrome,请转到 chrome://settings/)
  2. 尝试找到设置以清除 cookie、缓存数据、图像和文件、历史记录等。
  3. 成功找到后,清除浏览器的浏览历史、下载历史、缓存的图像和文件以及内容设置。
  4. 清除 phpMyAdmin 登录页面的 cookie。 注意:在 Internet Explorer 中,查看和删除 cookie 有点困难。如果您需要帮助,可以从 Ask Leo 获得有关在 IE 中查看 cookie的互联网文章。

I received the idea of performing the above instructions because I eyed someone at this GitHub issuementioning private mode. This is a comment from nik6018:

我收到执行上述说明的想法是因为我在这个 GitHub 问题上看到有人提到了私有模式。这是来自nik6018的评论:

As stated in #14234 Login via HTTP works if in private mode, but doesn't work in normal session. I tried to clear the cookie for the domain but still the same issue.

如#14234 中所述,通过 HTTP 登录在私有模式下有效,但在正常会话中无效。我试图清除域的 cookie,但仍然是同样的问题。

Private mode reminded me of issues I have had in the distant past like this one, and I remember having to clear various browser items.

On account of my reminder from the distant past, I tried the above instructions in a different sequence or way than I presented them, and it worked.

私人模式让我想起了我在很久以前遇到的问题,比如这个,我记得必须清除各种浏览器项目。

由于我来自遥远过去的提醒,我以不同于我提出的顺序或方式尝试了上述说明,并且它奏效了。

回答by Ibrahim

I had this issue today, and here are the steps that I did that helped me fix it on Chrome:

我今天遇到了这个问题,以下是我帮助我在 Chrome 上修复它的步骤:

enter image description here

在此处输入图片说明

1- Right click anywhere on the page, and choose "inspect" or click F12 to open developer tools.

1- 右击页面任意位置,选择“检查”或按F12打开开发者工具。

2- From the top menu, choose "Application".

2- 从顶部菜单中,选择“应用程序”。

3- Click Cookies on the left menu.

3- 单击左侧菜单上的 Cookie。

4- You will find some cookies there, click each one, and click "X" on the top to remove it. After removing all of them, refresh the page.

4- 您会在那里找到一些 cookie,单击每个 cookie,然后单击顶部的“X”将其删除。全部删除后,刷新页面。

回答by tp45

I had the same problem, but, in my case, the problem was my VPN, so I disabled it.

我遇到了同样的问题,但就我而言,问题出在我的 VPN 上,所以我禁用了它。

If you are using a VPN you need to disable it or just disable you cookie blocking.

如果您使用的是 VPN,则需要禁用它或仅禁用 cookie 阻止。

enter image description here

在此处输入图片说明

回答by Venantius

Well, it's one of two things. Either you don't have TLS/HTTPS enabled on your production box (which you definitely should! -- good resources for getting started are Let's Encryptand whatever host you're using) OR you're probably trying to access a development server in a production mode. In the latter case, while I'm not familiar with PHPMyAdmin myself I'd guess there's a configuration file somewhere that dictates when it should act like a production server versus a local server and you can just toggle that. But definitely don't toggle your production server to act like a development server, then you're just giving up security for convenience which will eventually come back to bite you.

嗯,这是两件事之一。要么您没有在生产设备上启用 TLS/HTTPS(您绝对应该这样做!--入门的好资源是Let's Encrypt和您使用的任何主机),或者您可能正在尝试访问开发服务器一种生产模式。在后一种情况下,虽然我自己不熟悉 PHPMyAdmin,但我猜想某处有一个配置文件,指示它何时应该像生产服务器和本地服务器一样运行,您可以切换它。但是绝对不要将您的生产服务器切换为像开发服务器一样,那样您只是为了方便而放弃安全性,最终会回来咬你。

回答by Ivan Ivanov

Just clear the cookies and the cache in your browser. This is how it worked for me.

只需清除浏览器中的 cookie 和缓存即可。这就是它对我的工作方式。

回答by DBStamps

I just ran into this problem using Firefox 61 on a site I had been using regularly, so I knew my config settings were correct. In fact, I could go in using Private Mode. So, in non-private mode, using the Firefox Developers Tools, I cleared ALL Session cookies and VOILA. Worked perfectly.

我刚刚在我经常使用的网站上使用 Firefox 61 遇到了这个问题,所以我知道我的配置设置是正确的。事实上,我可以使用私人模式。因此,在非私人模式下,使用 Firefox 开发人员工具,我清除了所有会话 cookie 和 VOILA。完美地工作。