dongxiansi0158 2014-04-12 05:42
浏览 34
已采纳

Hows身份验证会话在laravel中维护

I am using the laravel Framework of php for development.I m using the authentication in-built feature to login the user .following are my questions:-

  1. I want to know, how authentication class works and how it maintain authentication session of the user,can i access that user and if yes,then how?

  2. On laravel's Authentication Class's documentation page,it is written like

    If you would like to provide "remember me" functionality in your application, you may pass >true as the second argument to the attempt method, which will keep the user authenticated >indefinitely (or until they manually logout):

So, I want to know ,if i didnt specify the remember me , than how long my session gonna be there?

UPDATE :new problem

  1. Also ,In my db i have table user_auth instead of Users table and when i try to use authentication class ,its shows me error that users table is missing ,so after little effort ,i found and changed table name in auth.php in config folder ,but still its not working ,help me out?
  • 写回答

1条回答 默认 最新

  • dousu1916 2014-04-12 05:49
    关注

    Here you can find a really nice tutorial regarding registering/authenticating/filtering based on authentication status.

    To access the logged in user. You can check the Laravel security page Basically here :

    if (Auth::attempt(array('email' => $email, 'password' => $password, 'active' => 1)))
    {
        $email = Auth::user()->email;
    }
    

    Regarding session parameters ( how many minutes the session lives, etc ) you can check out

    app/config/session.php
    

    And see more informations regarding sessions here

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真