Difference between #1 and #2 of
Use Single Login Session on All Your Yii2 Application/Repository Under Same Domain/Sub Domain

Revision #2 has been created by aayushmhu on Sep 10, 2024, 12:24:36 PM with the memo:

article
« previous (#1) next (#3) »

Changes

Title unchanged

Use Single Login Session on All Your Yii2 Application/Repository Under Same Domain/Sub Domain

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags changed

session,login,single-login

Content changed


 
There are multiple blog that shows how to use seperate login for yii2 application but in this article i will show you how to use a single login screen for all your YII2 Advanced, YII2 Basic, Application, It will also work when your domain on diffrent server or the same server.

Here are few Steps you need to follow ot achive this.
[...]
Step 1 : Add this into your component inside

 
/path/common/config/main.php
 
```php
'components' => [
'user' => [
[...]
```


 
Step 2: Add Session and Request into main-local.php
 
/path/common/config/main-local.php
 
 
```php
'components' => [
'session' => [
[...]
/path/frontend/config/main-local.php

 
/path/backend/config/main-local.php
 
```php
'components' => [
'request' => [
[...]
Step 4: Note Somethign that you also have and console application so update session, user,and request into the main-local.php of your console application


 
/path/console/config/main-local.php
 
 
```php
'components' => [
'session' => null,
[...]
Step 1: Update You main-local.php of basic template


 
/path/basic-app/config/main-local.php
 
 
```php

'components' => [
'session' => [
'cookieParams' => [
'path' => '/',
[...]
0 0
0 follower
Viewed: 920 times
Version: 2.0
Category: Tutorials
Written by: aayushmhu
Last updated by: aayushmhu
Created on: Sep 10, 2024
Last updated: 9 days ago
Update Article

Revisions

View all history