Welcome Guest, Not a member yet? Register   Sign In
CI Reactor 2.0.1 Session Class. Data does not get passed.
#11

[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
#12

[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.
#13

[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";
or
Code:
$config['cookie_domain']    = ".leidsekoorprojecten.nl";
#14

[eluser]Maikh85[/eluser]
No success either after changing it to any of the proposed values Sad
#15

[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?
#16

[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
#17

[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.
#18

[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
Value    RzFRy9XmA43ODsyZqGvnFngtyrpzposUqJT/b21wJdxnVUnwwR221i8AsE1/4+suWPcPwmZu6g42JzNXdCW4/uAGslTM97S2JrCfHtF5ihGlHNFqUAGp+XLPqdDe/9hOvyt9yRMgBItWcwrY4uM1voQ0TE7Zozgt8ui5KXU6TVEtLIMOdmLhkFvlMZyrhzCDvSkFAYu/NR/phjcLTucc861GBnzd1G6n5ccBc7/3ZY3hD5fnIpPkLPLTCfnS3rAA5sGPQsVGClEy3AJCC8D69YGds4AvbAzDK7HFmi3fgFMVTyPh0C9RAk3O4pNCxQyciasvmrVwALfKA9FgO7TpNQ==
Host    .www.leidsekoorprojecten.nl
Path    /
Secure    Yes
Expires    At End Of Session

And on the page thereafter (where the session info is no longer available)
Code:
Name    cisession
Value    +MFrWCYDukt4G/h5fRUWe0wwtpfStxEGnAAA5JUqnQDgAOrdfulYz9G1eo1vzXUZ65sx5jPprhr8dgSxnv52TLmz9Y0GG1+jTxlWL7BysLt9NhzHk98lpbk/DGobLrh/JeyuPTZgTVKvY9DVeik14pM0+c0t0rgbfdWgcIWs3HL3Cfyu0iOPg0KSnVB3MfkBvxmJh9a7t35BfDM2atKCKlq6ozHBQfjhkHr7H1ySxk56nFUOMmywQkX7Ef0WQ9vtf8RkybBK4AyxBnaMGTYqwrT+ARQDTekMvE37Zj837kWW2tTvXUXs1brAZvzJOyD6pizWR1+trjQEzTu4IfYGOA==
Host    .leidsekoorprojecten.nl
Path    /
Secure    Yes
Expires    At End Of Session
#19

[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']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']        = "/";
$config['cookie_secure']    = true;

And what did:
Code:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']        = "/";
$config['cookie_secure']    = false;

Doh! No HTTPS connection is available. Sorry for your time guys!




Theme © iAndrew 2016 - Forum software by © MyBB