doutang3760 2018-10-10 14:12
浏览 75
已采纳

如何通过托管在同一域中的另一个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 ?

  • 写回答

1条回答 默认 最新

  • dongmei8511 2018-10-10 14:26
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?
  • ¥15 关于#vue.js#的问题:修改用户信息功能图片无法回显,数据库中只存了一张图片(相关搜索:字符串)
  • ¥15 texstudio的问题,