Jump to content
  • 0

PHP: get authenticated user info / status


moksamedia

Question

I'm working on a wordpress site and writing some custom PHP functions that access Caspio via the REST interface. I'm trying to figure out how to determine if the current user is logged in and get that user's info. 

I tried creating an HTML DataPage with the same authorization setup that simply echoed back the user info, hoping that if I logged into the website the REST request would be authenticated as well, but this didn't work. I also tried setting the PHPSESSID cookie in the request. Unfortunately, the REST request for the HTML datapage is always getting the login screen, regardless of if the user is logged in in the website.

How does Caspio track user authentication? 

Is there a known solution to this?

Thanks,

Andrew

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

You could track log in and log out actions by using API calls and write those entries into a Caspio table. Then by running a GET call you may know if user is logged in or not.

For simpler and quicker API integration, I would recommend you using this service: https://www.futuresuite.net/products/api-library.php

I hope this give you some light to resolve your issue.

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   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.

Loading...
×
×
  • Create New...