Session is not working on 000webhost

I currently using free service if 000… The problem is ,I use a simple login but the session is not setting? Can anybody there to help me??

Did you include session_start(); at the top of your PHP code?

Yes I did, but …I will show my cod on the session start page

if(!isset(SESSION ["a"])){
echo "something";
}else{
echo " hello world";
}

And the it shows the output of “something”

@sarathkumar Sessions works fine on 000webhost.
Include this piece of code in your “.htaccess” and then try you login system.
php_flag output_buffering on

3 Likes

Where is the .htaccess location in my 000 server

“Public_html”, if not create one using notepad and upload it. :slight_smile:

You mean ,I should create an folder naming. htacces ,then I should put the code in the folder.sorry man I am poor in English, just adjust.

Not folder, i mean if there is no “.htaccess” file, then create one using notepad or directly from file manager.

Now, Paste above code in your .htaccess file and try again.

Now clear, ok will do that and check …then…

Oh! My friend you are good, that’s working. Thank you

1 Like