• Resolved kestutisigaris

    (@kestutisigaris)


    Hi All,

    I am having a strange error when I try to add images to our adverts, the error text I get is: “Invalid Session. Please refresh the page and try again.” At first adding images function was working on Mozilla browser but on no other browsers, now its not working on Mozilla either. I did try to disable all the addons, but that did not remove the problem, anyone else came across the same problem, how did you solve it? Any help would be much appreciated as our classifieds section is not functional at the moment without the ability to add images to averts.

    Thanks in advance!

    Kind regards

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    sorry i missed your mesaage, i am checking the site right now but i am not sure what might be causing this problem.

    The only thing i noticed is that the wfvt_304361968 cookie changes with every request i do not know if that should be the case, either way this cookie is generated by WordFence plugin as far as i know so you can try disabling it and see if the upload will work.

    If you have other plugins for managing cookies you can try disabling them as when i check the cookies sent/received in WordPress headers there is quite a lot of default cookies missing which might be causing a problem, because the session is verified with nonces (https://codex.www.ads-software.com/WordPress_Nonces) which are saved in the database and assigned to a user using cookies.

    Thread Starter kestutisigaris

    (@kestutisigaris)

    Hi Greg,

    Thank you for your message, I disabled WordFence now, but unfortunately I still cannot add images. We do not have any other security add-ons or any add-ons that would somehow interact with cookies. I will leave WordFence disabled now, so perhaps you can have a look again and see what else could be causing this problem? Your help is much appreciated!

    P.S. In the last couple of days I tested this section of the website a few times and I could not add images on Mozilla also(previously we could), but after disabling WordFence now it works on Mozilla again(but not other browsers), so I have a feeling we are moving in the right direction. Fingers crossed.

    Plugin Author Greg Winiarski

    (@gwin)

    I am checking the website again, i still cannot upload a file but i also noticed that the gallery nonce (https://codex.www.ads-software.com/WordPress_Nonces) is a different each time i refresh the https://kid2kid.ie/adverts/add/ page.

    The nonce should be the same and reset only once your session ends. The problem might be then with the nonces system.

    Maybe the header with a nonce cannot be sent, you can try working around it, by opening your wp-config.php file and adding there the line

    
    ob_start();
    

    and then see if it works.

    One other thing that might be happening is that the nonces are not being saved in the wp_options table for some reason.

    The last resort would be to open a wpadverts/includes/ajax.php file and remove in adverts_gallery_upload() function the code which validates the nonce, but this is something you would need to re-do on each WPAdverts update.

    Thread Starter kestutisigaris

    (@kestutisigaris)

    Hi Greg,

    Thank you very much, the first suggestion where you suggested to add ob_start(); in wp-config.php unfortunately did not help, but I removed the nonces check from the suggested method in wpadverts/includes/ajax.php and now it works, we will have to remember to do this little change every time we update, but important thing for us now is that the site is fully functional. Thank you for your help and have a great weekend! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Invalid session error when adding images to adverts’ is closed to new replies.