Skip to content

fatal error when save ObjectID to php session #109

Closed
@lanlin

Description

@lanlin

I save some user base info with the CI's session driver, like userid, company_id... in an array.
All of these named xxx_id in the array are MongoDB's ObjectID, but when i save these data to session i got this error.

Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'MongoDB\BSON\ObjectID' is not allowed' in [no active file]:0 Stack trace: #0 [internal function]: session_write_close() #1 {main} thrown in [no active file] on line 0.

But, when using mongodb legacy driver for php, all things fine.
I don't know how to solve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions