6

Current system:

  • Have two Laravel project: 5.2 and 5.3
  • Using sub domain on local: control.foo-bar.dev (Laravel 5.2) and service.foo-bar.dev (Laravel 5.3)

.ENV setting:

APP_KEY=base64:tRpczdAlZ3jZ5VbP4sBU6BJcltftB5pBFpOuHbh/pq4=

SESSION_DRIVER=cookie

SESSION_DOMAIN=foo-bar.dev

config/app.php setting:

'cookie' => 'laravel_session'

Now I can login from Laravel 5.2 and can use that cookies for Laravel 5.3 but can't opposite.

I had try to change SESSION_DRIVER=cookie => database but get same result.

1 Answer 1

3

With this situation, I am pretty sure you have to prepend the dot on your cookie domain. eg:

SESSION_DOMAIN=.foo-bar.dev

Give it a go, see if it works.

Edit: Also, my 5.2 has the session cookie domain as null so make sure it is set to 'domain' => env('SESSION_DOMAIN', null), in your config/session.php

Sign up to request clarification or add additional context in comments.

1 Comment

I already set it. But this isn't problems. Problems come from laravel version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.