dongshan8194 2016-01-06 05:34
浏览 38
已采纳

在向会话添加数据后重定向时,Laravel会话不会保留

I am trying to save some key => values in the session before i redirect to Twitter OAUth page. The session is not persisting any data.

I have tested this in centos, ubuntu both running php5.6

PHP 5.6.16 (cli) (built: Nov 26 2015 08:01:30) Copyright (c) 1997-2015 The PHP Group

Apache version Server version: Apache/2.4.18 (CentOS) Server built: Dec 14 2015 18:39:31

I get no errors, the storage folder is writable and i get not errors at all.

Can someone please help me with this issues.

It turns out that no file is being written ("storage/framework/sessions").

The value 'driver' => env('SESSION_DRIVER', 'file'), is coming through, it doesn't work either if i change it to 'driver' => 'file',

Thanks

  • 写回答

1条回答 默认 最新

  • doubi4531 2016-01-11 09:45
    关注

    In order to get the Session working, the routes are supposed be declared within the following definition in routes.php

        Route::group(['middleware' => ['web']], function () { 
    
        });
    

    Thanks

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

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog