mardi 2 février 2016

remember me in laravel 5

my remember me functionality is not correctly working, Can any one help me with this..............

my problem is " when the user is logged in using remember me a cookie is being created but when he logs out the cookie is destroyed... that means when he wants to login again he has to remember his user name and password"

my Controller.php

$remember   = (Input::has('remember')) ? true : false;
if (\Auth::attempt('frontendUsers', array('cardno'    => Input::get('cardno'),'password'  => Input::get('password')), $remember)) 
                { 
...........................
}

my ajax

$("#loginform").submit(function(){

        var cardno       = $("#cardno").val();
        var password     = $("#pass").val();
        var catagory_id  = $("#catagory_id").val();

        var remember     = $("input[name = 'remember']:checked").length;

        $.ajax({
                url: '{{ url("postlogin") }}',

                dataType: 'json',

                type: 'post',

                data: {cardno:cardno,password:password,catagory_id:catagory_id,remember:remember},

                success: function( data, textStatus, jQxhr ){
.................
}
error:function(data){

                },
            });
            return false;
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire