why are you trying to serialize and save the session?

you don't need session_set_save_handler()

you very first line has to be session_start() before any other code.

and why do you have session_name twice? you don't even need that.

if you are on 4.2 then you must use $_SESSION[] the super global, unless you have globals turned on and for what reason I have no idea. by default it is turned off.