ci_session with multiple database not working |
I am working on a project where using two databases. My requirement is that, Depending on user login type load database e.g.
For user type 1 load db1(default database) Or For user type 2 load db2. Problem is that if login with user type 1 then logged in successfully but if login with user type 2 then login failed due to the ci_session table. how to fix this issue.
(05-02-2019, 06:53 PM)php_rocs Wrote: Why don't you initiate the session after the user is verified? If the login fails then simply send an error message and don't start the session. Because the session is used to identify someone who has successfully logged in but has been redirected to, or has navigated to some other page.
(05-02-2019, 01:17 PM)samtron Wrote: Problem is that if login with user type 1 then logged in successfully but if login with user type 2 then login failed due to the ci_session table. how to fix this issue. The fix is to not use PHP Code: $config['sess_driver'] = 'database'; Any other driver will work. (05-03-2019, 08:01 AM)dave friend Wrote:(05-02-2019, 01:17 PM)samtron Wrote: Problem is that if login with user type 1 then logged in successfully but if login with user type 2 then login failed due to the ci_session table. how to fix this issue. Any example?
(05-03-2019, 08:51 AM)samtron Wrote: Any example? 'files', ‘memcached’, or , 'redis' I usually use 'files'. It's easy to implement and proven to be responsive even on sites with daily session hits in the hundreds of thousands. If you need to handle millions of sessions a day then you want a memcached setup - and a better system admin than me. |
Welcome Guest, Not a member yet? Register Sign In |