laravel and multi-sessions from the same browser

后端 未结 8 1255
眼角桃花
眼角桃花 2020-12-02 21:00

In our web app, If I use a single browser, login to our application as user A, open another tab and login as user B - User A loses his session data. I assume this is due to

8条回答
  •  臣服心动
    2020-12-02 21:36

    Multi userlogin with same browser like google add account. for that you need follow some steps and re-write auth library which provided by the Laravel,

    Steps

    Tack backup of your Auth file.

    Change all session store functionality to store it first in array and then store that array to session

    Now you need to create the new session variable which will store the current user instance id like user 0 1 2 ...

    Now you need to change all the function from you will get the values from the session you need to check if the session object is empty then user is logout else you need to get data of the user base on the user instance.

    You need to change your instance when user want to switch from one account to another.

提交回复
热议问题