Search code examples
authenticationcodeigniter-2

CI - I added Flexi-Auth, then now I cannot show any pages, session_id issue in libraries/Session.php


I suppose libraries/Session.php is good. So the issue comes from my code or my settings.

I have added Flexi-Auth to get authentication in my software. And now, I cannot show any page in the browser.

I've empty the ci_sessions table and I've deleted ci_sessions cookie.

Not better.

To install Flexi Auth, I did : copy Flexi Auth files in the good places.

And change value of $config['security']['static_salt'] in flexi_auth.php.

Nota 1 : At the end of flexi_auth.php file, there is /* Location: ./system/application/config/flexi_auth.php */

But, there is no a application or config folder in system folder. So I copied this file to application/config/ folder.

The error is : Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'session_id`, `ip_address`, `user_agent`, `last_activity`, `user_data`) VALUES ('' at line 1

INSERT INTO ` (`session_id`, `ip_address`, `user_agent`, `last_activity`, `user_data`) VALUES ('aff26d184262b8c4a915adaa40286c19', '127.0.0.1', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/36.0.1985.125 Chrome/36.0.1985.125 ', 1409755863, '')

Filename: libraries/Session.php

Line Number: 344

Each time I refresh the default page, wich should only show 'coucou', this number aff26d184262b8c4a915adaa40286c19 and this one 1409755863, change.

It looks like the ci_sessions does not work any more.

This issue, came before I could create my first user, then, login in is impossible.

Nota 2 : The SQL script given by Flexi Auth to create ci_session table, is not the same as the ci_sessions table I allready have :

Flexi Auth script => user_agent varchar(120) DEFAULT NULL,

My ci_session table => user_agent varchar(120) NOT NULL,

But I don't think this changes something to my issue.

Thanks for help. Nils.


Solution

  • Don't read anymore, a comment baddly closed (* / instead */) in config file !