Jump to content

API Login Question

Recommended Posts

I am using the API to call validate login and it is working. Once the call returns with a success, I set session like so:


session_start(); // at the top of course


$_SESSION['uid'] = $results["userid"];

$_SESSION['upw'] = $results["passwordhash"];


But when I redirect to the WHMCS backend site, whmcs doesn't believe I am logged in.


I did a print_r on the $results and see a valid userid and passwordhash.


Maybe Validate Login doesn't actually log in a user?

Link to comment
Share on other sites

If you are asking if the API call will log the user in. It wont automatically. You will need to checkout to see what session variables are required for a user login. I am pretty sure there are more variables set then those two you mentioned and "upw" I don't believe is one of them. Though it could be...


Also check out AutoAuth it was developed for this purpose of logging a user into your site.

Link to comment
Share on other sites


To get the validatelogin API returned session variables working you might need to disable "Session IP Checking" in General Settings > Security. But otherwise yes, you could validate the email & password using the API call and then just generate and redirect to an AutoAuth URL to log the user in.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated