问题
What is the purpose of serializing/deserializing users into the session when using PassportJS? I worked with JSP before and there seems to be no notion of these things.
回答1:
It controls how the user instance gets saved to your session store (such as connect-redis).
I'm no expert on JSP, but I imagine there's some sort of ISerializable interface that classes must implement, which would be a rough equivalent.
来源:https://stackoverflow.com/questions/18640117/purpose-of-serializing-deserializing-users-into-a-session-when-using-passportjs