How do I pass JavaScript data to PHP?

How do I go about passing data from JavaScript code to PHP?

I have researched and found some ways like passing Session, Cookie or Ajax, but I don’t want to do it in those ways. Is there any other solution?