PHP session_set_save_handler Function

What is session_set_save_handler Function?


The "session_set_save_handler()" function is used to set user-level session storage functions.



In the above syntax the user-level session storage function, "open" is executed when the session is being opened, it has two parameters "save path" and "session name" "close" is executed when the session operation is done, "read" must return string value, "write" updates the session data, "destroy" this is executed when a session is destroyed using session_destroy, "gc" this is executed when the session garbage collector is executed.

Example :


In the above example, we have just given a sample code for session_set_save_handler() function.

PHP Topics

Ask Questions

Ask Question