【问题标题】:Session did't store values in live site会话没有在实时站点中存储值
【发布时间】:2023-03-08 04:17:01
【问题描述】:

我使用的是 laravel 4.2,并且在我的实时站点会话中没有存储值。这样 Auth::attemp();工作正常,但 Auth::check();返回总是假的。我已经尝试在会话文件中更改域名。提前致谢

routes.php

Route::controller('/admin', 'adminIndex');

adminIndex.php

function getShow()
{
   if (Auth::check())
    {
        return View::make('dashboard');
    }
    else
    {
        return Redirect::to('admin');
    }
}

function postIndex()
{
    $username = Input::get('username');
    $password = Input::get('password');

    if (Auth::attempt(array('username' => $username, 'password' => $password), true))
    {
        return Redirect::to("admin/show/");
    }
    else
    {
        return Redirect::to('admin')->with('message', 'Invalid User Name / Password.');
    }
}

【问题讨论】:

  • 现在检查。我正在更新我的问题。
  • 您的控制器名称是adminIndex 吗?

标签: session laravel laravel-4 session-variables session-cookies


【解决方案1】:

身份验证功能无法正常工作。它批准您的凭据并销毁会话。更新您的 laravel 库并尝试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-11
    • 2013-04-28
    • 2018-07-26
    • 2023-03-20
    • 2015-06-12
    • 1970-01-01
    • 2015-03-12
    • 2019-05-02
    相关资源
    最近更新 更多