I am trying to make login using ajax to send username and password to my php script for checking if there is any record in database, on my ajax success i want to reload the page in order to show something if session is created. I use session start on very top of my pages. Also on local server my login works perfect, but on ipage server i have this problem with losing session...(i tested it using var_dump($_SESSION) and its always
array (size=0) empty
session_save_path("your home directory path"/cgi-bin/tmp);
It turns out that my host changed servers and started using a different session save path other than /var/php_sessions which didn't exist anymore. A solution would have been to declare
ini_set(' session.save_path','SOME WRITABLE PATH'); in all my script files but that would have been a pain. I talked with the host and they explicitly set the session path to a real path that did exist. Hope this helps anyone having session path troubles.
Location of session folder: /domains/account/session location of index.php /domains/account/public_html/index.php
What I placed in
index.php at line 0:
<?php ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session')); session_start();
This is the only solution that worked for me. Hope this helps someone.