Customizing SMF > Portals, Bridges, and Integrations
login using smfapi_login via AJAX not generate cookie session
(1/1)
jlressia:
Hi everybody!
As the subject says, when i login to SMF using smfapi_login method from my website the session cookie is not generated. Then, if I close the browser, the session is lost and I need login again to access the forum..
Someone knows how to solve this issue?
Thanks!
ziycon:
Hi jlressia, can you explain a bit more how your logging into SMF is it from a page outside of SMF(custom page you built) or is this from within an SMF page? What mods do you have installed if any?
jlressia:
Hi Ziycon,
I have mi website in the root (hxxp:www.site.com [nonactive]) and SMF in a folder called "forum" (hxxp:www.site.com/forum [nonactive]).
When I want to make the login. From the website homepage I call to services.php file located in the forum folder. This call is made using JQUERY and pass login credential by POST method.
In the server side. I have the following code into the services.php:
--- Code: ---<?PHP
require_once('SSI.php');
require_once('smf_2_api.php');
smfapi_login($_REQUEST['username'],99999999999);
$result = smfapi_authenticate($_REQUEST['username'],$_REQUEST['password'],false);
echo $result;
?>
--- End code ---
Login works great! but don't generate the login cookie.
If i make a manual login from forum's login service the cookie is generated ok and i keep loged in after restart the browser.
Regards
Kindred:
it would seem not....
Navigation
[0] Message Index
Go to full version