A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
PHP : Problem with the method session_start();
Joined: Sep 04, 2009
Sep 08, 2009 03:57:19
I have mentioned this code
<?php session_start(); ?>
at 1st line of my code.
It is working fine in localhost. But when I uploaded to my server then it shows me the following warning
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at ......
After viewing this warning rest of the page working fine.
Can anybody help me ...how to remove this warning and tell me the reason for what this is coming only at server not in localhost.
Joined: Sep 13, 2007
Sep 09, 2009 06:48:45
Welcome to the Ranch Sudeep.
The reason could be your local Apache server and the server's Apache server configuration is not the same. One way to check is to echo the session_cache_limiter or check the phpinfo().
Base on the returned value, you may want to change it BEFORE calling session_start();
Another way is something to do with output buffering, which must be called (ob_start()) before session_start();
Hope this helps.
Joined: Sep 04, 2009
Sep 09, 2009 07:47:11
Thanks a lot.
I tried it in another way and it worked.
Here I am calling
method at the starting of my code.
But I am using session parameters some what later. I declared the same
method again here also.
Now it works fine
I think due to older version of php in the server it requires to initialize the session where exactly it needs.
By the way
Thanks for the valuable information and your time
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: PHP : Problem with the method session_start();
Need to implement Session time out in PHP code
html5 and php
difficulty in login in one attempt
php , html ...
using the value of a session variable
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015