search

Home  >  Q&A  >  body text

Can laravel not get the session after closing the CSRF of the specified controller method?

laravel Can't get the session after closing the CSRF of the specified controller method?

高洛峰高洛峰2798 days ago406

reply all(1)I'll reply

  • 阿神

    阿神2017-05-16 16:49:20

    Since we are closingCSRF,那么这个URL的来源可能是来自于 SWF其他途径

    If you access the current Domain的页面,这不可能会丢失Session based on browser

    I guess the possible scenario is the use of Flash上传文件,那么的确会出现丢失Cookie (what is the relationship between Cookie and Session)

    Normally, I will Session ID附加到这些场景的POST的字段、或上传的URL中:url?session_id=<?php echo session_id();?>

    Then reset the SessionID in the controller:

    session_id($_GET['seesion_id']);
    Session::setId($_GET['seesion_id']);

    If you use a browser to access normally, there is no need to do this.

    reply
    0
  • Cancelreply