如何通过托管在同一域中的另一个laravel应用程序访问php应用程序的会话?

如何通过托管在同一域中的另一个laravel应用程序访问php应用程序的会话?

问题描述:

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 ?

我在 domain.loc strong>上托管了一个php应用程序(非Laravel)。 p>

我需要访问 login code>的 session code>数据到另一个使用Laravel开发并托管在同一域中的 应用程序(它是 地址是'domain.loc / testing')。 p>

domain.loc - [Non Laravel App] p>

域。 loc / testing - [Laravel App] p> blockquote>

是否有任何方法可以在不使用令牌的情况下访问laravel应用程序中的非laravel应用程序会话 基于 code> 身份验证。 p>

或者我们是否可以通过非laravel应用程序验证laravel应用程序? p> div>

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.