cluel3ss's avatar

Remember me function not working

I have deployed my Laravel application to my server and have come across a problem when checking Remember Me on login, the following error is displayed:

SQLSTATE[HY000]: General error: 8 attempt to write a readonly database (SQL: update "users" set "remember_token" = HH0dtQYZ5BgoOpya1hNRUrFvIZF0dcYqdIvAjz0k6CbTKBqah7wWPdQbgzzL, "updated_at" = 2016-06-18 12:47:43 where "id" = 1)

I only receive this error when checking the 'Remember Me' checkbox on login and when logging out, I am able to run all other CRUD actions via the app to my SQLite database fine which leads me to believe maybe this is not a database file permission issue.

Any ideas why I am getting these errors?

0 likes
5 replies
d3xt3r's avatar

Hmm, do you use different database connections for different models? If yes, is the permission appropriately set for user model's connection?

Snapey's avatar

Did you use the standard migrations? Is the remember_token column 100 character varchar?

cluel3ss's avatar

@d3xt3r Nope, I use SQLite connection for all models (wasn't even aware we could differentiate them depending on model)

@Snapey yes, I used the standard migration to create the user table

cluel3ss's avatar

@Snapey I've come across this page before, my /app/database directory and /app/database/database.sqlite file are both set to 755 and are owned by the same user. I have also changed the owner:group of the file to the same user which runs php, neither have resolved the problem

Edit: I have chown'd the parent directory and it now works :-)

Please or to participate in this conversation.