I am using this code to retrieve php session variables.
session_start();
$username = $_SESSION['username1'];
$password = $_SESSION['password1'];
echo $username;
When I execute it, I get the following error.
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home/practice/public_html/wp-content/themes/twentytwelve/header.php:13) in /home/practice/public_html/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()’d code on line 2
If I remove session_start(), I get no error.
But in both cases, the session variable is not retrieved and the command echo $username;
doesn't show anything.
display_errorson? elseini_set('display_errors', '1');You might see what the error is.