CodeIgniter Forums
Having a really odd problem with sessions. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Having a really odd problem with sessions. (/showthread.php?tid=57326)



Having a really odd problem with sessions. - El Forum - 03-06-2013

[eluser]code3r[/eluser]
I really can't figure this out it is so bizarre. I use Cloudflare's protection services to mask my ip. I have also installed a mod_cloudflare so that the incomming user ips are not masked. I am a bit of a beginner with Codeigniter so help would be so greatly appreciated!

Anyways heres my sessions configuration:
Code:
$config['sess_cookie_name']  = 'vmcsession';
$config['sess_expiration']  = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name']  = 'ci_sessions';
$config['sess_match_ip']  = TRUE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update'] = 300;

When my Cloudflare protection is enabled, 3 sessions will be created therefor preventing my login script from working. These are all created when the login button is pressed.
[Image: 6557fbb21cbda33531ec33ef3e0bea29.png?1362628511]

However, when my domain is pointed directly to my server with no proxy ip, one session will be created and my login function works fine.

I can donate via paypal to someone who helps me solve this



Having a really odd problem with sessions. - El Forum - 03-07-2013

[eluser]Kyle Johnson[/eluser]
I've seen several sessions generated for one person as well.

It might be that the User Agent field is too short (update your ci_session.user_agent to varchar(200) or something similar)


Having a really odd problem with sessions. - El Forum - 03-07-2013

[eluser]CroNiX[/eluser]
@kyle that won't matter since internally it's only looking at the first x characters (forgot the number off the top of my head), but increasing the size in the db will have no affect unless you change it in the code as well.


Having a really odd problem with sessions. - El Forum - 03-07-2013

[eluser]code3r[/eluser]
I appreciate the replies. The script is working fine as long as the domain is pointed directly to the server. This is the part that makes no sense. I really need this problem fixed help is so greatly appreciated.


Having a really odd problem with sessions. - El Forum - 03-09-2013

[eluser]code3r[/eluser]
Bump. Please anybody I so badly need this.


Having a really odd problem with sessions. - El Forum - 11-05-2013

[eluser]Unknown[/eluser]
Hello,

I had the same problem and I solved it by using: https://github.com/EllisLab/CodeIgniter/wiki/Dariusz-Debowczyk's-Session-Class

I don't know exactly what the explication is, but it works.