Getting the current menu item id from specific menu

This was the solution to my problem:

Then what I would do is to store the clicked anchor in a cookie using javascript and read it while loading the new page. $_SERVER[‘HTTP_REFERER’] won’t be reliable here. – Luis Sanz Jul 19 at 12:33