-2

Unable to start session due to the warning. I am trying to host my PHP website through BlueHost.com. But it keeps giving me warnings saying session startup failed. I tried to change the save handler by making new folder but still it the same. Can someone please help me out with it.

1 Answers1

0

Enter your session_start() function after <?php in live server

For Example:

<?php session_start();

//Enter your php code here

?>

Don't do this:

<?php

session_start();

//Your code

?>
Burhan
  • 21
  • 4
  • It didn't work. Problem is in providing the session.save_path which is not saving the path that I provide. I am trying to change the path but for some reason, it is not accepting it. Currently, I am trying with session.save_path= "/home1/proctekw/public_html/php_sessions " which is also not working even though folder is present. And my project pages are stored in home1/proctekw/public_html/Timesheet. – DHRUVIL PATEL Jul 24 '20 at 21:52
  • @DHRUVILPATEL You send me your code then I think of a solution – Burhan Jul 25 '20 at 06:33
  • Thank you for the support. I was able to identify the solution. The problem was hosting website was not allowing me to change the php.ini file to start a session, I change the code at run time and it worked perfectly. I used this code: ini_set('session.serialize_handler','php'); ini_set('session.save_handler', 'files'); – DHRUVIL PATEL Jul 28 '20 at 15:01