Welcome Guest, Not a member yet? Register   Sign In
ci_sessions - session creation
#1

[eluser]edhrx[/eluser]
hi, I'm using 2.1.3 of codeigniter. I want to use a database to capture session data, and I'm using vanilla codeigniter stuff. So I using a table ci_sessions and I have set the encryption.
When i use the welcome controller it creates a record in the table. If I refresh it creates a record. I created a link in the welcome_message view. nothing fancy just a call to another page. And this creates a record in ci_sessions table.

Am I missing some parameter, I'm thinking there should only be 1 session record for all of this....

Ed.
#2

[eluser]Pert[/eluser]
[quote author="edhrx" date="1370329658"]
Am I missing some parameter, I'm thinking there should only be 1 session record for all of this....
[/quote]

Can you copy-paste your session settings from config.php? Could be something from here, matching IP could be broken as IPv4 and IPv6 do not play ball depending on server configuration.

Try to switch all the matching other matching (match browser, match IP) settings off.
#3

[eluser]RogerMore[/eluser]
Hi Ed,

If after shutting off all of the matching ip and useragent stuff it still doesn't work properly, you can take a look at the following:

When using the database for sessions, CI is still leaning heavily on cookies for sessions.
CI writes a cookie for session which contains you're session id. When CI is preparing the session it will look for the cookie and tries to match a session in the db with the sesion id found in the cookie. Maybe there is something wrong with your cookies because of privacy settings in your browser.

Maybe it is an idea to setup the logging function of CI, because if there is something wrong the session library writes all sorts of stuff to the log before killing a session.

Roger
#4

[eluser]edhrx[/eluser]
@all
thanks for help it was cookie related. It was'nt creating them. Fixed.




Theme © iAndrew 2016 - Forum software by © MyBB