Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sandygajera's avatar

Login user data not fetching on new request

Hi,

I have facing one issue in laravel 5.6 Auth.

First time user login into system using auth::attempt() successfully and same that page auth::check() return 1 but after redirecting into other page or url , not getting login user detail or auth::check() not return any data.

Any one help me for solving this issue.

0 likes
5 replies
munazzil's avatar

Have you used this in your controller function and you can access the 'auth' session,By adding top of your controller functions.

public function __construct()
      {
          $this->middleware('auth');    
      }
jlrdw's avatar

Check the storage folder permissions, have to be writable. Also set something in a session, anything, and bring up another page and see if you can retrieve it.

sandygajera's avatar

@JLRDW - Hi,

Storage folder writable permission but I set session that not get value on next page.

Can you please help me what problem ?

jlrdw's avatar

Make sure your storage session folder it's actually storing the session data.

storage/framework/sessions

If not check folder permissions and make sure that folder can be written to.

Try 755

Please or to participate in this conversation.