{"action":"closed","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/8670","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/8670/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/8670/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/8670/events","html_url":"https://github.com/yiisoft/yii2/issues/8670","id":85535158,"number":8670,"title":"Allow DbSession store particular data in the separated column.","user":{"login":"klimov-paul","id":1482054,"avatar_url":"https://avatars.githubusercontent.com/u/1482054?v=3","gravatar_id":"","url":"https://api.github.com/users/klimov-paul","html_url":"https://github.com/klimov-paul","followers_url":"https://api.github.com/users/klimov-paul/followers","following_url":"https://api.github.com/users/klimov-paul/following{/other_user}","gists_url":"https://api.github.com/users/klimov-paul/gists{/gist_id}","starred_url":"https://api.github.com/users/klimov-paul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimov-paul/subscriptions","organizations_url":"https://api.github.com/users/klimov-paul/orgs","repos_url":"https://api.github.com/users/klimov-paul/repos","events_url":"https://api.github.com/users/klimov-paul/events{/privacy}","received_events_url":"https://api.github.com/users/klimov-paul/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-05T13:37:31Z","updated_at":"2015-06-09T10:12:33Z","closed_at":"2015-06-09T10:12:33Z","body":"For the custom session storages like DB, MongoDB or Redis, It would be nice to have built-in support for storing particular session data in separated fields. For example, allow to store `userId` in the separated column of 'session' table with `DbSession`.\r\n\r\nTypical use case: I want to see all active sessions for the particular user and perhaps drop some of them (or all of them) if needed. Such functionality provided by GMail for example.\r\nIn morden systems with high security demands restriction: 1 active session per 1 registered user is very common.\r\nOf course this can not be implemented at plain `yii\\web\\Session` or `yii\\web\\CacheSession`, but can be present in `DbSession`, `MongoSession` and so on.\r\n\r\nWe can introduce array map in format: sessionKey => storageColumnName, which can be used for actual data set composition.\r\nCommon related functionality can be composed into a trait or a abstract base class."}}