/    Sign up×
Community /Pin to ProfileBookmark

PHP Social Login Verify

Hello everyone!
I’m working on a website’s login/registration part and i want to make the social login/registration possible on the site.
I’m already using HybridAuth for the social login.
Do i have to check the access token or whatever whenever the user sends a new request?
What is the best practice for verifying the social login?

So i was thinking about a flow like this:
– I login with Facebook
– I want to open an another part of the website
– – Verify the user’s social identity
– – If no problem with it, move forward and run the login and serve the content, otherwise 404 or redirect to login.
This flow would send a request to facebook to check the identity, slowing down the loading of my website, how can i overcome this?
Thanks a lot!
(Sorry for my English.)

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 08.2015 — You should only need to verify the login once per session, at which point you store something in $_SESSION to indicate the user is already logged in. Then on each page request, the first thing you look for is that $_SESSION element/value pair, to see if they're logged in (and if not go to the log-in form, or display a message with login link, or whatever you want to do).
×

Success!

Help @newboyhun spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...