Laravel, 2 projects in 2 domains same session

212
January 19, 2017, at 07:34 AM

I'm creating 2 projects in 2 diferent domains domain1.tld and domain2.tld.

The domain1.tld is the main event producer page and the domain2.tld is one of its events. I want to share the same sessions (they actually share the same database and the same apache server). I tried to change the session driver to "database" and create a session table, but nothing happens, if i'm log in domain1.tld nothing happens in domain2.tld.

I really have searched in the net but i have found nothing

Answer 1

you can't do this in your way...

when you set session, a cookie set in browser for track stored session in server side.

if you want to share session between two domain you should share cookie between to site bot you can not do it (you can do it just in sub domains of ONE domain)

but there is a little hack : The easiest work-around is to pass login/credential information from website A to website B and have website B set a seperate cookie. For example, after logging into website A you could have them quickly redirected to website B with an encrypted querystring. Website B could then read the information, set its own cookie, and redirect the user back to site A.

It's messy but possible.

READ ALSO
Error using SOAP with PHP with a tag mismatch

Error using SOAP with PHP with a tag mismatch

Good afternoon developers,

367
WordPress htaccess setup for secure access

WordPress htaccess setup for secure access

Trying to setup WordPresshtaccess file so we can use HTTPS on a site

239
PHP how is a DOMNodeList constructed

PHP how is a DOMNodeList constructed

I realize DOMNodeList is meant to be a special type of "live" readonly reference list, but out of curiosity, how does it get constructed by other classes? For example, how does DOMNode "getBy*" functions construct a DOMNodeList?

251
Generate dynamic time slot using php mysql

Generate dynamic time slot using php mysql

I am building an event based website where I need to display dynamic time slot for the attendees

263