• Resolved winnewoerp

    (@joschi81)


    Hi there,

    I don’t know exactly if this is a coding issue or another problem with my blog settings in general: After a comment validation error page, the content disappears after clicking the back button (the form is empty). Also, the respective .php page is reloading completely (instead of retrieving it from the cache in another blog I have, where it works correctly).

    Here’s a bit of code:

    add_filter( 'preprocess_comment', 'verify_comment_meta_data' );
    function verify_comment_meta_data( $commentdata ) {
    if ($_POST['comment_code'] != $_SESSION['rand_code'])
    	wp_die( __( 'Fehlermeldung: Sie haben nicht den richtigen Spamschutz-Code eingegeben.' ) );
    	return $commentdata;
    }

    As I said, the problem might be outside this snippet…

    Thanks
    Josch

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter winnewoerp

    (@joschi81)

    OK, finally, here we go:

    session_cache_limiter was missing. So this is how I’m starting the session now:

    add_action( 'init', 'mymap_session_start' );
    
    function mymap_session_start() {
      if( !session_id() ) {
         session_cache_limiter ('private, must-revalidate');
         session_start();
      }
    }

    Anyway, thanks for your help!

    Thread Starter winnewoerp

    (@joschi81)

    Don’t know if I already marked it as resolved. So here we go.

    Best regards!

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Comment validation: Data disappears after clicking "back" button’ is closed to new replies.