0
I want login page whenever Yii2 project open in browser.

Let me know what steps do we need to follow to destroy session when system will have power off.

1 Answers1

0

You should set enableAutoLogin to false in your config file. This setting is false by default but the basic and advanced Yii2 template both set this value to true.

When it is false the cookie that will be created for the login will not be used to authenticate the user when 'first' coming on the page and so the login page will be displayed.

The docs:

http://www.yiiframework.com/doc-2.0/yii-web-user.html#$enableAutoLogin-detail

Jap Mul
  • 17,398
  • 5
  • 55
  • 66