Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HybridAuth not authenticating when using custom php session path

I have an issue when using the HybridAuth plugin. I have included the plugin as a popup in in my home page. When clicking on the login button from home page the plugin will load in colorbox.

In my server I can't use default php session save path so that I have set it as php temp path for saving session like below in index.php of my root folder.

$dir = sys_get_temp_dir();
session_save_path($dir);

After updating this code, the plugin is authenticating the social media that customer selecting successfully and return back to my site, but it is not passing the below condition,

$hybridauth->isConnectedWith( $_GET["connected_with"] ) // it is always return false

In second case I have updated the session save path in index.php of plugin folder also, but at at that time in the login popup instead of showing login UI it is directly showing an error page like below

"You cannot access this page directly."

Any help would be appreciated. Thanks in advance.

like image 237
user3804331 Avatar asked Jul 04 '14 07:07

user3804331


1 Answers

The problem is your default session path:

$dir = sys_get_temp_dir();
session_save_path($dir);

I would print_r sessions to see what got registered. Why do you have issues with default session path? I wouldn't try to alter it and make sure that works first. This is altering the main functionality of HybridAuth.

Why can't you use the default php session save path? are you on a shared host?

--

If you have shell access make sure the web server user has write access to the directory; that should take care of the issue.

like image 192
unixmiah Avatar answered Sep 25 '22 23:09

unixmiah