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 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应