Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Session Problems Thread
#20

[eluser]WanWizard[/eluser]
This is not related to CI, but to HTTP specifications.

If you don't use output buffering, cookies (or any HTTP header for that matter) have to be send before you start sending output. If not, PHP throws a notice error (headers already send).

If you had suspected CI, you didn't see the error. So make sure you have all error reporting active and display errors enabled in your development environment to spot such errors.

Back to CI:

The session library sets the session cookie every time your call sess_write(), which gets called when you update session data. This can happen anywhere in your application flow.
However, CI uses the Output class to buffer all output, compress it if needed, and send it out. Which only happens after your controller is finished and has returned control to the front controller.

So even with output buffering off this is not an issue, unless your application generates output that bypasses the output class (i.e. every echo or print statement). In a CI app, this is not-done!


Messages In This Thread
CodeIgniter Session Problems Thread - by El Forum - 11-19-2009, 01:05 PM
CodeIgniter Session Problems Thread - by El Forum - 11-19-2009, 02:49 PM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 07:59 AM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 08:11 AM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 10:51 AM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 12:48 PM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 01:27 PM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 01:45 PM
CodeIgniter Session Problems Thread - by El Forum - 11-20-2009, 05:25 PM
CodeIgniter Session Problems Thread - by El Forum - 11-21-2009, 11:49 AM
CodeIgniter Session Problems Thread - by El Forum - 12-03-2009, 01:45 PM
CodeIgniter Session Problems Thread - by El Forum - 12-03-2009, 02:29 PM
CodeIgniter Session Problems Thread - by El Forum - 12-05-2009, 04:25 AM
CodeIgniter Session Problems Thread - by El Forum - 05-16-2010, 01:03 AM
CodeIgniter Session Problems Thread - by El Forum - 05-16-2010, 03:17 AM
CodeIgniter Session Problems Thread - by El Forum - 08-23-2010, 10:32 PM
CodeIgniter Session Problems Thread - by El Forum - 08-24-2010, 03:32 AM
CodeIgniter Session Problems Thread - by El Forum - 08-24-2010, 08:43 AM
CodeIgniter Session Problems Thread - by El Forum - 09-16-2010, 01:59 AM
CodeIgniter Session Problems Thread - by El Forum - 09-16-2010, 08:47 AM
CodeIgniter Session Problems Thread - by El Forum - 09-17-2010, 07:45 PM
CodeIgniter Session Problems Thread - by El Forum - 09-18-2010, 03:44 AM
CodeIgniter Session Problems Thread - by El Forum - 09-18-2010, 07:02 AM
CodeIgniter Session Problems Thread - by El Forum - 06-03-2011, 08:36 AM
CodeIgniter Session Problems Thread - by El Forum - 06-03-2011, 08:44 AM
CodeIgniter Session Problems Thread - by El Forum - 06-03-2011, 08:53 AM
CodeIgniter Session Problems Thread - by El Forum - 06-06-2011, 12:34 AM
CodeIgniter Session Problems Thread - by El Forum - 06-06-2011, 09:19 AM
CodeIgniter Session Problems Thread - by El Forum - 03-07-2012, 10:26 AM
CodeIgniter Session Problems Thread - by El Forum - 03-07-2012, 10:51 AM
CodeIgniter Session Problems Thread - by El Forum - 03-07-2012, 11:10 AM
CodeIgniter Session Problems Thread - by El Forum - 05-21-2013, 03:09 AM
CodeIgniter Session Problems Thread - by El Forum - 05-21-2013, 03:12 AM
CodeIgniter Session Problems Thread - by El Forum - 06-28-2013, 02:56 PM
CodeIgniter Session Problems Thread - by El Forum - 08-21-2013, 02:58 AM
CodeIgniter Session Problems Thread - by El Forum - 08-22-2013, 12:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB