Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi Larry,

I have been using your database session handler for quite some time now in my Windows 7 environment but have run into a problem when I try to use it in a new PC set up with Windows 10 and Apache/PHP 7.3.7 (64 bit).

I keep getting an error: "An error occurred in script 'C:\xampp\htdocs\....php' on line 53: session_write_close(): Session callback expects true/false return value" and I am getting this error everywhere that I have used 'session_write_close()' as per page 95 of the book (that's in dozens of places).

Is it perhaps not needed in Win 10 with a fairly current Apache/PHP install?  Or do I need to code it differently?

Any advice will be most appreciated and thanks in anticipation.


Share this post

Link to post
Share on other sites

I checked with the PHP manual and from PHP 7.2 the return from session_write_close() is a Boolean rather than a void.

Might this require an update to the session code in the book?

I tried just adding $rc = session_write_close() but I'm still getting the error.

Thanks, Necuima

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...