I have tried to increase session time, cookies time from admin panel And php.ini file. But both ways are not working for me. Still, the session expires in 30 mins. I want to make it for a day.
Stores > Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds)
Also there is a possibility to set this parameter directly to database, just put a value under path
in the table core_config_data
Magento 2.1 admin cookie life time = Stores > Settings > Configuration
Advanced > Admin > Security > Admin Session Lifetime (seconds) or till the user closes the browser
Since Magento 2.1 introduces lifetime for admin cookie as "expires on browser close", together with value in Stores >Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds). That means, that session life time equals value in Stores > Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds) or when a browser is closed.
Or you can set up a new value for admin cookie, like it is proposed in fschmengler's answer
For Customer Session
Please check this magento user guide related to customer session
I hope this will help
You can set the expired time in below configuration which can solved your problem. But If you close the browser then it will automatically session expired. Also after Magento 2.1 there are some enhancement build in version which can timeout the session after sometime for security reason.
Stores => Settings => Configuration => Advanced => Admin => Security => Admin Session Lifetime(Seconds)
Hope it can be helpful for you.
To change the session timeout interval for the administrator in Magento 2, follow these steps:
- Log in to Magento using your administrator account.
- In the left sidebar, click Stores, and then under Settings, click Configuration.
- Click Advanced, and then click Admin.
- Under Security, in the Admin Session Lifetime (seconds) text box, type the session timeout interval in seconds that you want to use. For example, a value of 1200 sets a timeout interval of 20 minutes.
- Click Save Config.
- Log out of Magento, and then log back in. The new session timeout interval is now active.