The IRF
The IRF

Reputation: 470

Session is not storing variable PHP

I have started session in the header.php and included in all files but when I declare a variable like $_SESSION['var_name']="Hello"; and get it on other file like echo $_SESSION['var_name']; and I have my php.ini in the folder which contains

session.save_path = "C:\Xampp\tmp"

But it's return null & when i use print_r($_SESSION); it's return array( ). I removed php.ini file and restart the xampp server but didn't get any thing.

Upvotes: 1

Views: 39

Answers (1)

The IRF
The IRF

Reputation: 470

Thanks for your contribution but I found the solution I created .htaccess and put content

<IfModule php7_module>
  session.save_path = "C:\Xampp\tmp"
</IfModule>

And that works for me And my other .ini file are containing

session.save_path = "C:\Xampp\tmp"

Upvotes: 1

Related Questions