$_SESSION Not working on CPANEL.
When we uploaded it to the web host using CPANEL
the $_SESSION
is not working.
But in local using XAMPP it is working.
$_SESSION Not working on CPANEL.
When we uploaded it to the web host using CPANEL
the $_SESSION
is not working.
But in local using XAMPP it is working.
Sessions
are enabled by default within any PHP installations and hence do not need any special configuration to enable sessions.
You should make sure you have session_start();
as the first line in any page where you want to use sessions; it should be the very first line, before any whitespace (an empty line, for example).
Hope it helps you.
you have make sure to write <?php session_start();?>
in the first line of page
you should insert session_start() in the beginning of the script. Make confirm you call it on every page you need the access to session variables as well
Solved! the problem is, I put all my session on other php file so when include the php I put it under the html code.
I mean like this:
<html> <?php ?> </html>
so when I update it to this
<?php ?> <html>
all stuff are good. thanks for the comment guys <3
Place your session_start() at top of your page or header before the actual html