CI Reactor 2.0.1 Session Class. Data does not get passed. |
[eluser]InsiteFX[/eluser]
Try this: Code: $config['cookie_domain'] = ($_SERVER['SERVER_NAME'] == 'localhost' ? '' : preg_replace('/^www\./', '', $_SERVER['SERVER_NAME'])); If your running FireFox with firebug you can check with firebug to see if your getting the cookie InsiteFX
[eluser]Maikh85[/eluser]
[quote author="InsiteFX" date="1302043378"]Try this: Code: $config['cookie_domain'] = ($_SERVER['SERVER_NAME'] == 'localhost' ? '' : preg_replace('/^www\./', '', $_SERVER['SERVER_NAME'])); If your running FireFox with firebug you can check with firebug to see if your getting the cookie InsiteFX[/quote] Hi InsiteFX, After applying your code, I can see the cookie 'cisession' in Firebug. However, without those settings the cookie is set as well. If you fill out the form in http://www.leidsekoorprojecten.nl/ideal/ you'll arrive at an overview page. This overview page has a var_dump() of the session. Click the green button again and you'll see the same var_dump() but without the variables set on the page before. It's as if the session gets reset. Puzzling really.. Had no problems with sessions in 2.0.1 on another domain.
[eluser]WanWizard[/eluser]
You've configured Code: $config['cookie_domain'] = "leidsekoorprojecten.nl"; but you surf to http://www.leidsekoorprojecten.nl/ideal/. Shouldn't the domain be Code: $config['cookie_domain'] = "www.leidsekoorprojecten.nl"; Code: $config['cookie_domain'] = ".leidsekoorprojecten.nl";
[eluser]Maikh85[/eluser]
No success either after changing it to any of the proposed values
[eluser]WanWizard[/eluser]
ok, back to debugging. Install (if not present) the web developers toolbar plugin, and use the cookies function to display your site's cookies. It opens in a separate tab. Is your cookie there? What it it's host, value and expires?
[eluser]InsiteFX[/eluser]
When you switch pages I belive the session library regenerates the session_id which means you would have to get the session value again for displaying it. Correct me if I am wrong on that WanWizard. InsiteFX
[eluser]WanWizard[/eluser]
By default the session id is regenerated every 300 seconds. When a new session record is created at every page request (easy to monitor by looking at the db), you can have 1. session cookie not accepted/stored by the browser 2. session cookie not seen as valid by CI 1. could be cookie name, path or domain issues, cookie expiry time issues (p.e. server/client timezone issues), and occasionally proxies that f***s things up 2. could be an encryption/decryption issue, a payload over 4Kb issue, expired session id (timezone issues), IP check enabled with alternating IP's (loadbalancing proxies for example) Difficult to say which of these cases is the actual problem here, you need to debug this.
[eluser]Maikh85[/eluser]
[quote author="WanWizard" date="1302061414"]ok, back to debugging. Install (if not present) the web developers toolbar plugin, and use the cookies function to display your site's cookies. It opens in a separate tab. Is your cookie there? What it it's host, value and expires?[/quote] On the page immediately after posting (where the session info is correctly displayed) Code: Name cisession And on the page thereafter (where the session info is no longer available) Code: Name cisession
[eluser]Maikh85[/eluser]
So, after hours and hours of debugging and searching, I've tried to swap my config file with config files of other CI projects. Suddenly things started working. Curious where things went bad, I compared both config files. The difference that caused the sessions to go wrong was in the value of a 'Cookie related variable'. What did not work: Code: $config['cookie_prefix'] = ""; And what did: Code: $config['cookie_prefix'] = ""; Doh! No HTTPS connection is available. Sorry for your time guys! |
Welcome Guest, Not a member yet? Register Sign In |