我的会话文件不可写
我创建了chmod -R 777存储/框架/会话,但每个请求都要创建一个会话文件。
我使用PHP 1.5.26的1& 1共享服务器
app.blade.php
<?php
$encrypter = app('Illuminate\Encryption\Encrypter');
$encrypted_token = $encrypter->encrypt(csrf_token());
?>
<meta name="csrf-token" content="{{<?php echo $encrypted_token ?>}}">
main.js
$.ajaxSetup({
headers: { 'X-CSRF-TOKEN' : $('meta[name=csrf-token]').attr('content') }
});
login.blade.php
@section('loginForm')
{!! Form::open(['route'=>'login', 'role' => 'form', 'name' => 'loginForm', 'id'=>'loginForm', 'data-toggle' => 'validator', 'class' => 'form-horizontal' ]) !!}
<div class="form-group has-feedback">
<label for="email" class="col-sm-2 control-label hidepola">Email</label>
<div class="col-sm-10">
<input class="form-control" data-error="El correo de seguir esta forma ejemplo.correo@dominio.com" pattern="^[_a-z0-9]+(\.[_a-z0-9]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" type="email" name="email" placeholder="Correo" required>
<div class="help-block with-errors" ></div>
</div>
</div>
<div class="form-group has-feedback">
<label for="password" class="col-sm-2 control-label hidepola">Contraseña</label>
<div class="col-sm-10">
<input data-minlength-error="Minimo son 6 caracteres" data-minlength="6" maxlength="16" class="form-control" type="password" name="password" placeholder="Contraseña" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10 col-xs-12">
<div class="checkbox" id="ingresa">
<label>
<input type="checkbox"> Recordarme
<a href="{{ URL::route('recoverView') }}">¿Olvidaste tu Contraseña?</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
{!! Form::submit('Iniciar Sesion',['class' => 'btn btn-primary']) !!}
</div>
</div>
{!! Form::close() !!}
@stop
AuthController
if (Auth::attempt(['email' => $data['email'], 'password' => $data['password'], 'is_active' => 1],$request->has('remember'))) {
return response()->json([
'success' => [
'message' => 'Login User'
]
], 200);
}
我的回购是here 非常感谢
答案 0 :(得分:0)
在远程服务器清理会话文件夹中,然后授予文件夹777权限。
但我建议您将会话驱动程序更改为:
在config / session.php文件中 并在使用COOKIE驱动程序时启用加密(&#39;加密&#39; =&gt; true)
我们知道会话ID存储在cookie中,那么为什么不将整个会话数据保存在cookie中并加密呢?
答案 1 :(得分:0)