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

matbeard's avatar

Error with Session database driver

I've been developing a Laravel 5.2 application locally and I've just set it up on our production server. I've now got a problem when using the database session driver.

The first visit to the site works okay, but any subsequent page view returns the following error:

ErrorException in Carbon.php line 1891:
Object of class Illuminate\Foundation\Application could not be converted to int

If I then clear out the brower's cookies using the developer tools, I can load the page again. I don't have the same problem using the cookie or files session driver, but I need to use the database driver for my shopping cart implementation.

A row is created in the sessions table in my database (but I notice the ip_address and user_agent columns are blank... don't know if that's related).

Any suggestions as to what the problem could be? (I can post the entire error report if necessary)

0 likes
1 reply
matbeard's avatar
matbeard
OP
Best Answer
Level 4

SOLVED - I've cleared out the bootstrap/cache folder and everything is working again.

Please or to participate in this conversation.