3

I have a php application (Non Laravel) hosted on domain.loc.

I need to access the session data of that to login to another application which is developed using Laravel and hosted in same domain (it's address is 'domain.loc/testing').

domain.loc -- [Non Laravel App]

domain.loc/testing -- [Laravel App]

Is there any possible way to access a session of non-laravel application in a laravel application without using token-based authentication.

Or is there anyway where we can authenticate a laravel application via a non-laravel application ?

1 Answer 1

4

Add session_start() at the beginning of the index.php file found in the public folder. This will "resume" the php session.

After that you can access the session using the php superglobal $_SESSION['foo'] in your laravel app.

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

2 Comments

Thank you Angad. It worked. Does this affect Laravel session or can we use both without any issues?
@IsuruBuddhika This will not affect the Laravel session.

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.