[PHP] session woes
I had my script working beautifully on my box but when transferring to dev server no such luck Because we have an older version of php on the webservers, I had to get my admin to change the php.ini on the session.use_trans_id = 1 so that the SID wouldnt show in the URL. But I'm not sure if that's what is causing my problem now. It seems I'm not able to transfer and use session data from one page to another. I registerd and stored my var in a session variable and can see it on sess_downloads_p2 but then I loose it on p3. I'm also getting [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cookie - headers already sent by (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 where line 60 is my session_start(); I'm kinda clueless as to what to try next. Thanks for any ideas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session woes
You need to make sure that output_buffering is turned on in your php.ini file on the dev server. ?php /* Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com [EMAIL PROTECTED] 562.924.4454 (office) 562.924.4075 (fax) continuing the struggle against bad code */ ? From: Mignon Hunter [EMAIL PROTECTED] Date: Wed, 23 Mar 2005 11:20:24 -0600 To: php-general@lists.php.net Subject: [PHP] session woes I had my script working beautifully on my box but when transferring to dev server no such luck Because we have an older version of php on the webservers, I had to get my admin to change the php.ini on the session.use_trans_id = 1 so that the SID wouldnt show in the URL. But I'm not sure if that's what is causing my problem now. It seems I'm not able to transfer and use session data from one page to another. I registerd and stored my var in a session variable and can see it on sess_downloads_p2 but then I loose it on p3. I'm also getting [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cookie - headers already sent by (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 where line 60 is my session_start(); I'm kinda clueless as to what to try next. Thanks for any ideas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session woes
Mignon Hunter wrote: ... [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cookie - headers already sent by (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 Your script has output on line 5. (it's possible that this is whitespace character(s) as those count as output as well). mr_obviousYou currently are trying to send headers after you already sent output. This is a problem because PHP thought it already sent all of the headers, but oops, it didn't!/mr_obvious If the output buffering answer doesn't work for you then you should go back to line 5 and verify / eliminate the output that is produced on that line. Or you can move the session_start() and / or other functions that are sending headers before output on line 5. There's more than one way to skin this cat. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
Re: [PHP] session woes[RESOLVED]
Bingo ya know I knew that about the headers but it threw me since it worked on my box perfectly no matter where I put the session_start(); Lo and behold I check out the php.ini on my box and there it was: output buffering=4096 I did not know about the output buffering. BUT I just moved my session_start(); to the very tip top in we're in ship shape. Sorry for all the strange sayings Thanks so much to Jason, Stephen and John Ciao Stephen Johnson [EMAIL PROTECTED] 03/23/05 11:30AM You need to make sure that output_buffering is turned on in your php.ini file on the dev server. ?php /* Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com [EMAIL PROTECTED] 562.924.4454 (office) 562.924.4075 (fax) continuing the struggle against bad code */ ? From: Mignon Hunter [EMAIL PROTECTED] Date: Wed, 23 Mar 2005 11:20:24 -0600 To: php-general@lists.php.net Subject: [PHP] session woes I had my script working beautifully on my box but when transferring to dev server no such luck Because we have an older version of php on the webservers, I had to get my admin to change the php.ini on the session.use_trans_id = 1 so that the SID wouldnt show in the URL. But I'm not sure if that's what is causing my problem now. It seems I'm not able to transfer and use session data from one page to another. I registerd and stored my var in a session variable and can see it on sess_downloads_p2 but then I loose it on p3. I'm also getting [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cookie - headers already sent by (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 [23-Mar-2005 09:04:47] PHP Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/htdocs/sess_downloads_p2.php:5) in /var/www/htdocs/sess_downloads_p2.php on line 60 where line 60 is my session_start(); I'm kinda clueless as to what to try next. Thanks for any ideas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session woes
Hi All, I have a bit of a problem using the session management functions in PHP4. (PHP 4.1.2 in fact) I have a order wizard system on my website that is using PHP sessions to track values entered on the various forms across all pages of the wizard. at the start of each page i am issuing the session_start(); command. Session ID's are passed in the GET string as part of the URL, and form values are posted.. each page submits the user data back onto itself (I have all my validation etc at the top of the document) - thus if the user fails to enter certain values, the page doesnt move into the next step, but instead alert them to their errors. if the form values pass, the form will move on to the next page using a header(location: nextpage.php) command. the problem I have, however, is that on the third page of my wizard, if the user submits only some of the required fields, it submits back onto itself and displays an error as required, but the problem is that when you fill in the missing fields and move on to the next page (in effect back onto itself first, then on to the next page) the fields that had their values missing, are not passed along... Does this all make sense? I can provide all the code samples if need be. I have tested this scenario using a PC running apache under Win2K, and also on a Unix box with Apache - same problem. Thanks for any help. M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session woes
Is register_globals turned on or off? - Original Message - From: Gaylen Fraley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 09, 2001 6:13 AM Subject: [PHP] session woes I have a friend who is using an ISP that uses php4.0.3pl1 . It appears that session_register is not working between pages. In script A, the session var gets registered and shows registered using session_is_registered('testvar'); However, when script B is called, a session-start is issued and testvar is not registered. Running the identical code, but not with his ISP, under 4.06, it works perfectly. Are there known issues? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com PHP KISGB v2.5 Guest Book http://www.gaylenandmargie.com/phpwebsite -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session woes
I have a friend who is using an ISP that uses php4.0.3pl1 . It appears that session_register is not working between pages. In script A, the session var gets registered and shows registered using session_is_registered('testvar'); However, when script B is called, a session-start is issued and testvar is not registered. Running the identical code, but not with his ISP, under 4.06, it works perfectly. Are there known issues? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com PHP KISGB v2.5 Guest Book http://www.gaylenandmargie.com/phpwebsite -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]