I install PHP, Apache, and MySQL done and worked. When I finish installing Phpmyadmin, then open it has an error.
Failed to set session cookie. Maybe you are
My solution was to disable (add an exception for my domain) to the "Privacy Badger" Firefox Extension.
As soon as I did this, I was able to log in.
The other solutions in this post (config.ini.php, browser cache, VPN) did not do anything for me. Seems like the issue is primarily tied to environment / browser config, which could be unique for each person.
I don't think it's an issue with PHPMyAdmin.
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 Encrypt and 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.
I had this issue because I am hosting phpmyadmin behind an nginx reverse proxy, using Docker Compose. In my docker-compose.yml
file I had:
db-admin:
# https://hub.docker.com/r/phpmyadmin/phpmyadmin/
image: phpmyadmin/phpmyadmin:latest
restart: always
environment:
- PMA_ARBITRARY=1
- PMA_HOST=http://db
- PMA_PORT=3306
- PMA_ABSOLUTE_URI=http://localhost/db-admin/ # necessary because the db-admin is hosted behind a reverse proxy.
ports:
- 8084:80
depends_on:
- db
networks:
- shared-network
Due to the reverse-proxy and the PMA_ABSOLUTE_URI, I can only use this application on http://localhost/db-admin
, not on http://localhost:8084
.
I had the same problem and a quick workaround was to use Incognito mode
The issue should be solved using phpMyAdmin 4.9.2 as I made a fix for it but if you still have the issue please comment on https://github.com/phpmyadmin/phpmyadmin/issues/15634
William, phpMyAdmin team
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)
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 out the user and password lines and makes sure the auth_type is set to cookie.
From my experience, this action needs to take place for phpMyAdmin to operate with cookie authentication before you move on.
Next perform the following steps to solve the session cookie not working with HTTP:
I received the idea of performing the above instructions because I eyed someone at this GitHub issue mentioning private mode. This is a comment from 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.
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.