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 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应