Automatically expire a wallet connection

What I’m about to ask is similar to how cookies work in web 2. A cookie that logs a user in will expire after some days, maybe 30 days.

When does MetaMask expire a wallet connection? How long does it take?

Do you mean a wallet connection to a dapp? Or when MetaMask unlocks/locks and requires to to enter a password?

I was thinking of the former but answers to both will be fine, thanks.

Wallet connection does not expire, it would require you to manually disconnect.

Here is more information on our Knowledge Base:


Hello @Olaleye !

Programmable connection and disconnection of the wallet to the web3 application isn’t not possible.

The connect/disconnect functionality is entirely in the user’s hands due to security and privacy concerns.

:boom:In addition to this, I want to attach a post from the MetaMask github on this topic:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.