du8794 2018-09-05 14:53
浏览 126
已采纳

在PHP中创建会话,然后在JSP中检查该会话

I want to be able to create a session in PHP so that my JSP file can check for that session value and know that the PHP file was reached.

The idea is:

  1. User goes to PHP file - session is created

  2. The PHP file now redirects to a webapp

  3. The web app notices the user isn't logged in and redirects to the JSP file for the user to log in.

  4. The JSP will check if the PHP file was accessed by checking for the created session ID. If it was reached, it will auto-login for the user. If it wasn't reached, then we let the user log in.

Can this be done? If the PHP file redirects to the webapp which then redirects to the JSP, will the session still exist?

  • 写回答

1条回答 默认 最新

  • dongshou6041 2018-09-17 19:24
    关注

    Using cookies over sessions work just as well. This solved my problem.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!