Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
[Solved] Session throwing duplicate primary key error (trying to make 2 sessions)
  • [ Leaving this here in case someone else is having this problem ]

    I was using the Session class with the DB driver. When asking for a new session and you don't have the session cookie identifier, it would throw a 
    "Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation"

    It looked like the shutdown event was happening twice. It was.

    Since 1.3, the index.php file in the /public directory, doesn't manually call 
    Event::shutdown();

    Solution: Just remove that line and no more duplicate shutdown events; no more duplicate inserts, no more errors! :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!