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

jthorpe's avatar

Password reset not working in Microsoft Browsers - Production only

Last week I received a report from a customer that they were unable to reset their password on a site I launched a couple months ago. I was unable to reproduce the bug in my development (local) environment or my test (Forge - Digital Ocean) environment, but was able to reproduce it in Edge and Internet Explorer on my production server (another Forge - Digital Ocean server). The odd part is the test environment and the live environment are almost identical. The biggest difference I can see is that the test server is on Ubuntu 14.02.2 and live is running 14.02.4.

The actual password reset does occur, but the error is thrown while logging the user in and displaying the first page of the site. This is what I see in my log file (some parts altered for anonymity):

[2018-05-25 08:29:23] production.ERROR: Trying to get property of non-object (View: /home/forge/[mydomain]/resources/views/layouts/sidebar1.blade.php) (View: /home/forge/[mydomain]/resources/views/layouts/sidebar1.blade.php) {"userId":272,"email":"[email protected]","exception":"[object] (ErrorException(code: 0): Trying to get property of non-object (View: /home/forge/[mydomain]/resources/views/layouts/sidebar1.blade.php) (View: /home/forge/[mydomain]/resources/views/layouts/sidebar1.blade.php) at /home/forge/[mydomain]/storage/framework/views/32dbf62f9e87c92eccd2b86a3e4ea98acc5362b7.php:4, ErrorException(code: 0): Trying to get property of non-object (View: /home/forge/[mydomain]/resources/views/layouts/sidebar1.blade.php) at /home/forge/[mydomain]/storage/framework/views/32dbf62f9e87c92eccd2b86a3e4ea98acc5362b7.php:4, ErrorException(code: 0): Trying to get property of non-object at /home/forge/[mydomain]/storage/framework/views/32dbf62f9e87c92eccd2b86a3e4ea98acc5362b7.php:4) [stacktrace]

This is the line from the view (the compiled version from storage/framework) mentioned in the log file, which leads me to believe Edge and IE are having some sort of issue accessing or writing to the session. However, if that were the case I would assume the same problem would at least be occurring on the test server as well.

<?php if(\Carbon\Carbon::now() >= Session::get('season')->claim_start && \Carbon\Carbon::now() <= Session::get('season')->claim_end): ?>

I found this Stack Overflow post and tried their cookie fix, but didn't have any luck: https://stackoverflow.com/questions/33240144/laravel-login-not-working-in-edge-and-internet-explorer/40814059#40814059

On a whim I also tried applying this middleware that I've used on other sites, but didn't have any luck with it either: https://robinz.in/csrf-token-session-error-with-laravel-on-ie-edge/

I'm sure there must be a difference between my dev/test and production servers. Any ideas?

Thanks

0 likes
2 replies
lostdreamer_nl's avatar
  • Where do you set the season data in the session?
  • After changing the cookie name, you might need to delete all domain cookies in your browser (it might still be sending the wrong cookie)
  • after changing config settings, you might want to clear the cached config (php artisan config:clear)
jthorpe's avatar

Thanks for the quick response.

I set the season data in both the login method of the LoginController and the index method of my HomeController that shows the landing page. It's probably overkill, but I wanted to make sure it was set in both in case the user ever had to hit either of those independently.

I just tested it again after deleting all browser data from Edge and clearing the cached config from the server and got the same result.

I also double checked storage permissions on both my test and live server and don't see any differences.

Please or to participate in this conversation.