【发布时间】: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