1

I'm searching for Create Sessions Manager page in Yii2 Framework.

I am looking for solution to the following problems:

List all current sessions active in server, get user's information from sessions such as: 1. username 2. ip 3. current url

Is there any example? I am new in Yii, so any help would be appreciated.

HTiT
  • 13
  • 2
  • Have you read the official documentation: http://www.yiiframework.com/doc-2.0/yii-web-session.html. If yes then please specify what problems you are facing? – Chinmay Waghmare Mar 20 '15 at 03:52
  • @chinmay, that guide only for current session. I would like to list all sessions actived in server include: username, ip, current url – HTiT Mar 20 '15 at 09:23
  • @HTiT I answer your question in details at [this link](https://stackoverflow.com/questions/45537969/how-to-create-user-session-manage-system-in-yii2-with-dbsession/45537970#45537970) – Mortie Aug 07 '17 at 00:40

1 Answers1

0

You can use DbSession which will store all your session in database, from which you can get all the information and can create your own Session Manager.

You can create your own custom DbSession class as per your convenient to store extra data like user id, etc.

Akshay Vanjare
  • 655
  • 3
  • 10
  • thanks @Akshay Vanjare, I used DbSession to store all sessions, I added column user_id to session_table and my problem's solved. – HTiT Mar 24 '15 at 19:44