# Config.json settings

**URL:** https://forum.mattermost.com/t/config-json-settings/6238
**Category:** Troubleshooting
**Created:** [November 27, 2018, 11:39am UTC](https://forum.mattermost.com/t/config-json-settings/6238 "2018-11-27T11:39:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kevin.byrne](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kevin.byrne](https://forum.mattermost.com/u/kevin.byrne)
#### Post date: [November 27, 2018, 11:39am UTC](https://forum.mattermost.com/t/config-json-settings/6238/1 "2018-11-27T11:39:47Z")

</div>

On first run of mattermost app, Is it possible to define auto login from the config.json.  
Also can we run mattermost with a different config location/file.

Regards.  
K

---

<div class="post-metadata">

### Author: ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)
#### Post date: [November 27, 2018, 4:39pm UTC](https://forum.mattermost.com/t/config-json-settings/6238/2 "2018-11-27T16:39:11Z")

</div>

Hi @kevin.byrne,

For auto-login: There are two cookies that need to be set to login without a password and username. Here’s an example of how to set them:

```auto
setcookie('MMUSERID', '<user id from database>', time()+606024*30, ‘/’, ‘.yourdomain.com’, true, true);
setcookie('MMAUTHTOKEN', '<Authentication Token Value>', time()+606024*30, ‘/’, ‘.yourdomain.com’, true, true);

```

Replace `<user id from database>` and `<Authentication Token Value>` with their respective values for that user. You can get both of these values with a database query, or by using the authentication instructions for the [Mattermost API.](https://api.mattermost.com/#tag/authentication).

---

<div class="post-metadata">

### Author: ![kevin.byrne](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kevin.byrne](https://forum.mattermost.com/u/kevin.byrne)
#### Post date: [November 28, 2018, 11:36am UTC](https://forum.mattermost.com/t/config-json-settings/6238/3 "2018-11-28T11:36:03Z")

</div>

Thanks @amy.blais - this is actually for the Windows desktop application.  
Is there any way to have the setting below enabled by default?  
 ![Image%20Pasted%20at%202018-11-28%2011-31](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex020/uploads/mattermost/original/2X/2/228171db11ef753548ed82d74dfe9a1480bab220.png)

---

<div class="post-metadata">

### Author: ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)
#### Post date: [November 28, 2018, 4:18pm UTC](https://forum.mattermost.com/t/config-json-settings/6238/4 "2018-11-28T16:18:19Z")

</div>

Hi @kevin.byrne,

Currently that setting is disabled by default: [https://docs.mattermost.com/help/apps/desktop-guide.html?highlight=desktop#app-options](https://docs.mattermost.com/help/apps/desktop-guide.html?highlight=desktop#app-options).

To have it enabled by default, you can open a feature request ticket in the desktop app repo ([https://github.com/mattermost/desktop/issues](https://github.com/mattermost/desktop/issues)).

---

<div class="post-metadata">

### Author: ![JtheBAB](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jthebab/32/2702_2.png) [@JtheBAB](https://forum.mattermost.com/u/JtheBAB)
#### Post date: [November 28, 2018, 5:27pm UTC](https://forum.mattermost.com/t/config-json-settings/6238/5 "2018-11-28T17:27:33Z")

</div>

Hi @kevin.byrne

You can depoly a registry key with GPO Preferences to set this as default.

The key is within HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
