Pages

Friday, February 25, 2011

Session handling solved.....


Hi....
 Handling a sesion is always an important issue.

Normally errors will be thrown in default, when there is an issue or errors in sessions handling but sometimes this may not work.

One of that is what we came across recently
When we developed a website in our home country and the servers also resides in same place there is no errors or warnings related with sessions.
But after we shift the server to other country it started to throw warning like
"Session alreday created" even after we cleared old sessions using ob_start();
and started a new session
session_start();

the warnings occured because these functions were declared after some PHP coding
but the same code never thrown any warnings ever in local(the server when it is in home country).

Tips:
1. You can avoid showing unwanted warning/errors by using error_reporting(0)

So next time you got error or warning check you have called these functions at the beginning of the file.

No comments:

Post a Comment