ThinkingMonkey
ThinkingMonkey

Reputation: 12727

Is it better to use session_set_save_handler?

Is is better to use session_set_save_handler and set our own mechanism or let PHP handle it? If yes/no why? I do not want to store the session in a DB because of the overhead in Input/output. I am thinking of using memcache for storing the sessions.

Upvotes: 1

Views: 968

Answers (1)

deceze
deceze

Reputation: 522382

If you want to use memcached as a session store, you just need to change the session.save_handler configuration to memcached for that to work automatically. Other extensions may offer similar predefined session handlers.

If there's no session handler that you like, you can create your own and register it using session_set_save_handler. Otherwise, don't reinvent the wheel.

Upvotes: 3

Related Questions