当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Session in Laravel 4.2 doesn't works

问题描述:

I have a problem with session in laravel , I use cookies driver

In localhost works fine , but in shared hosting (Hostgator) dosen't work

Same code.

This is the code in Route.php

Route::get('/SetSession',function(){

Session::put('Domain','http://example.com');

return Session::get('Domain');

});

Route::get('/GetSession',function(){

return Session::get('Domain');

});

I don't know what is the problem , in shared host empty value , but in localhost works fine.

session.php file

http://paste.ofcode.org/XPeC3zb6f898tcsxUthSGg

网友答案:

Yes , I found a problem , I have a space before php tag in Route.php

Like this :

   <?php 


?>
分享给朋友:
您可能感兴趣的文章:
随机阅读: