# Admin users can't login, normal users can

**URL:** <https://forum.gitea.com/t/admin-users-cant-login-normal-users-can/1664>\
**Category:** Install/Maintain/Configure\
**Created:** [November 16, 2019, 10:05pm UTC](https://forum.gitea.com/t/admin-users-cant-login-normal-users-can/1664 "2019-11-16T22:05:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linuxpython](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@linuxpython](https://forum.gitea.com/u/linuxpython)\
**Post date:** [November 16, 2019, 10:05pm UTC](https://forum.gitea.com/t/admin-users-cant-login-normal-users-can/1664/1 "2019-11-16T22:05:51Z")

</div>

I have created a gitea instance on localhost and copied the repos and database from a working server. However, on localhost, logging in does not work for the admin user, just for normal users. If I try to login as the admin user, I am getting redirected to the login page immediately, and on the top right I can see “Sign In”. If I use the wrong password, I get an error message. I tried to create another admin user from the command line, but this user has the same problem. I am using 1.10.0 on Debian Buster/amd64, together with a Pg database. What gives?

---

<div class="post-metadata">

**Author:** ![guillep2k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/guillep2k/32/646_2.png) [@guillep2k](https://forum.gitea.com/u/guillep2k)\
**Post date:** [November 20, 2019, 2:02pm UTC](https://forum.gitea.com/t/admin-users-cant-login-normal-users-can/1664/2 "2019-11-20T14:02:05Z")

</div>

I’d suggest you create a new user with admin privileges and regenerate keys and hooks from command line using:

```bash
gitea --config /path/to/app.ini admin create-user --username newadmin --password value --email unique-email@mycompany --admin
gitea --config /path/to/app.ini admin regenerate keys
gitea --config /path/to/app.ini admin regenerate hooks 

```

If you can get in with this new admin, you can go and check what’s wrong with your other user. But probably some problems may have happened by just moving the program around.

---

<div class="post-metadata">

**Author:** ![linuxpython](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@linuxpython](https://forum.gitea.com/u/linuxpython)\
**Post date:** [December 9, 2019, 8:58am UTC](https://forum.gitea.com/t/admin-users-cant-login-normal-users-can/1664/3 "2019-12-09T08:58:24Z")

</div>

Thank you for the idea, but this didn’t solve this specific problem. It turned out that it’s a hit-and-miss experience to begin with, for every user (with “miss” being the normal result). In the end, I figured that, when running on localhost, I need to change my [session] configuration like this:

From:

COOKIE\_SECURE = True # production setting

to:

COOKIE\_SECURE = False # when running on localhost w/o SSL
