Q:

Laravel Authentication Issue for Version 5.1

I have issue of authentication. In version 5.1 it's working fine in local but on server getting weird error. check() function always return false but I had debug in authentication controller I got the true in attempt() function but why check() return false after redirection?
config/auth.php:
return [

    'driver' => 'eloquent',
    'model' => 'App\Company',
    'table' => 'company',
    'password' => [
        'email' => 'emails.password',
        'table' => 'password_resets',
        'expire' => 60,
    ],
];

Company model class
<?php

namespace Testnamespace;

use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Route;
use Sofa\Eloquence\Eloquence;

class Company extends Model implements AuthenticatableContract, CanResetPasswordContract, SluggableInterface
{

    use Authenticatable, CanResetPassword, SoftDeletes, SluggableTrait, Eloquence;

    public $timestamps = true;
    protected $table = 'company';
    protected $dates = ['deleted_at'];
    protected $fillable = [
        'email',
        'password',
        'name',
        'info',
        'extra_info',
        'phone',
        'mobile',
        'street',
        'postal_code',
        'website',
        'facebook',
        'newsletter'
    ];
    protected $sluggable = [
        'build_from' => 'name',
        'save_to' => 'slug',
    ];
    protected $searchableColumns = ['name'];
    protected $primaryKey = 'id';

}

A:

If you are using subdomain then change this line below (config/session)
'domain' => null,

to
'domain' => '.yourdomain.com',

Also if you are using files to store session 
'driver' => env('SESSION_DRIVER', 'file'),

then check if you have write permission given to storage/framework/sessions directory . you also can try changing database sessions .

