Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Michealm's avatar

sharing laravel session with wordpress

now before anyone freeks out i know this is everywhere but never in any real depth or related to how i need to do it :P

so what i have is our main site which is WordPress example.com, which is just a front end

we also have members area in laravel at members.example.com

they do not want to have to sign in twice so i need a way to share the laravel login session with WordPress so if they are logged in on the laravel side, WordPress just goes ok your good to go and allows them access.

if someone could explain how to accomplish this in a relatively simple and fast implementation that would be great!

Thanks

0 likes
6 replies
Michealm's avatar

the users on on laravel's side and i need wordpress to accept and allow the session data from laravel so that once there logged in on the laravel side, wordpress just goes with it

Michealm's avatar

i just need a way to transfer the laravel session to wordpress simple as that

bobbybouwmann's avatar

Well you can't, because Laravel is using a different session mechanisme than WordPress. I think it's better to login on both systems and use that instead. You can use the API of WordPress to do so.

Michealm's avatar

ok so a little background, i have corcel for laravel that is allowing me to access content from wordpress to use in laravel, i am also using a plugin in wordpress to use the laravel user DB for authentication (currently as they have to login twice, this method copies the username and email when they login form the laravel db to wp db for future logins, if it does not exist already)

no if the user has already logged in and there account is in the DB then all i would have to do is pass there username to the wp set auth cookie i think to authenticate them ???

and if they have not been logged in before, the will have to login twice but that is the only time they will have to do it unless im understanding this incorrectly

the name of the plugin is External Database Authentication Reloaded

what do you think, that is if that makes sense to you lol :D

Siva2406's avatar

@michealm By any chance, you cracked this? I have a similar requirement. Don't know how to do it. Could you help me?

Please or to participate in this conversation.