CodeIgniter Forums

Full Version: Set Cookie?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Suhas nazir[/eluser]
Hello all i have a function x in my controller and there are some session set
and unset in this function when i try to acess this function the browser didnt display my view file in the function x instead it shows "set-cookie" and some of my session values that i set in the function what might be the problem......???thanks in advance

El Forum

[eluser]ram4nd[/eluser]
Can you post your code?

El Forum

[eluser]SneakyDave[/eluser]
I have this same problem, after moving an app from PHP4 to PHP5 environment.

Posting the code doesn't matter much in my opinion, because it appears the error happens when the session library is loaded.

But I did grab a DEBUG level log of the page being displayed.

In my instance, my application saves form data to a session, and repopulates that data in the form if the user doesn't change it, once the user changes the data, and the form is submitted, then the (not quite) an error message appears above.

I assumed it had something to do with saving the session, but again, the error appears to happen when the session library is loaded, as it doesn't even get into the controller.

Here is my debug output from the time that I changed a form value, and re-posted the page. There are a lot of form fields, and XSS filtering is on. My controller and view name is "query".

But this debug output doesn't tell me where this output is happening, I would assume its in the session library.

I can confirm that it happens whether the session library uses a database or not.
Code:
DEBUG - 2010-09-29 15:42:14 --> Config Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Hooks Class Initialized
DEBUG - 2010-09-29 15:42:14 --> URI Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Router Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Output Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Input Class Initialized
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> XSS Filtering completed
DEBUG - 2010-09-29 15:42:14 --> Global POST and COOKIE data sanitized
DEBUG - 2010-09-29 15:42:14 --> Language Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Loader Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Helper loaded: url_helper
DEBUG - 2010-09-29 15:42:14 --> Helper loaded: form_helper
DEBUG - 2010-09-29 15:42:14 --> Helper loaded: date_helper
DEBUG - 2010-09-29 15:42:14 --> Helper loaded: string_helper
DEBUG - 2010-09-29 15:42:14 --> Database Driver Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Session Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Session routines successfully run
DEBUG - 2010-09-29 15:42:14 --> Form Validation Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Controller Class Initialized
DEBUG - 2010-09-29 15:42:14 --> Language file loaded: language/english/form_validation_lang.php
DEBUG - 2010-09-29 15:42:14 --> Helper loaded: file_helper
DEBUG - 2010-09-29 15:42:14 --> Pagination Class Initialized
DEBUG - 2010-09-29 15:42:14 --> File loaded: .//views/_GLOBAL/header.php
DEBUG - 2010-09-29 15:42:14 --> Language file loaded: language/english/date_lang.php
DEBUG - 2010-09-29 15:42:14 --> File loaded: .//views/_GLOBAL/footer.php
DEBUG - 2010-09-29 15:42:14 --> File loaded: .//views/query.php
DEBUG - 2010-09-29 15:42:14 --> Final output sent to browser
DEBUG - 2010-09-29 15:42:14 --> Total execution time: 0.0617

El Forum

[eluser]WanWizard[/eluser]
set_cookie() creates an HTTP header entry. For some reason the page your webserver sends out has a corrupted header, which causes the 'set-cookie:' header to end up in the page.

Try using a debug tool that can grab the complete output including headers that your webserver sends to the browser (not sure firebug can do that, I know fiddler can), and check the results carefully for an indication of the possible issue.