• When I log out, after a partial booking, I get these warnings:

    Warning: session_destroy(): Trying to destroy uninitialized session in /web_dir/wp-content/plugins/book-a-room/sharedFunctions.php on line 119

    Warning: Cannot modify header information – headers already sent by (output started at /web_dir/wp-content/plugins/book-a-room/sharedFunctions.php:119) in /web_dir/wp-includes/pluggable.php on line 1219

    • This topic was modified 6 years, 3 months ago by speedy_snail.
    • This topic was modified 6 years, 3 months ago by speedy_snail.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter speedy_snail

    (@speedy_snail)

    Also, note these messages when attempting to log in:

    Warning: session_destroy(): Trying to destroy uninitialized session in /web_dir/wp-content/plugins/book-a-room/sharedFunctions.php on line 119

    ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.

    • This reply was modified 6 years, 3 months ago by speedy_snail.
    • This reply was modified 6 years, 3 months ago by speedy_snail.

    I put up a new update that should fix this. CAn you please try it?

    Thread Starter speedy_snail

    (@speedy_snail)

    Wow thanks for all the replies (on other tickets).

    I’ve been busy, hence slight delay. Hoping to try all your suggestions out… I’ll reply as soon as I can.

    Thread Starter speedy_snail

    (@speedy_snail)

    Hi

    Your fix mends the login warnings, but not the logout.

    I changed this code in sharedFunctions.php, to fix the logout session warnings:

    if( !function_exists( "myEndSession" ) ) {
    	function myEndSession() {
    		if (isset($_SESSION)) {
    			if (session_id()) {
    				session_destroy();
    			}
    			unset($_SESSION);
    		}
    	}
    }

    Thanks! I was going to add something similar, and I’d eventually like to move to transients instead of SESSION variables. I’ll get an updated version out soon.

    Thread Starter speedy_snail

    (@speedy_snail)

    Thanks! I appreciate that. I don’t know about transients, I’ll check them out.

    Thread Starter speedy_snail

    (@speedy_snail)

    This bug still occurs with the latest version

    Warning: session_destroy(): Trying to destroy uninitialized session in /wp-content/plugins/book-a-room/sharedFunctions.php on line 119

    Warning: Cannot modify header information – headers already sent by (output started at /wp-content/plugins/book-a-room/sharedFunctions.php:119) in /wp-includes/pluggable.php on line 1219

    The fix I initially supplied seems to fix the issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Headers already sent – when logging out’ is closed to new replies.