Now of days it's quite easy to have a computer in a completely different part of the world from where I'm located that I'm working on. This makes me wonder how 'criminality' is defined if the laws of my home country differ from the country the computer is in. I'm wondering at what point the location of a server/computer decide the laws that apply to it and at what point it's the location of the user that matters.
To give some examples, not so much expecting answers to all of the below so much as explaining my confusion of distinction in case it informs an answer.
For example, lets say I choose to view material that is not legal for me to view in my home state (copyright material I haven't payed for, some type of outlawed pornography, some sort of state secret I'm not suppose to see etc), but which is legal to view in the country in which some server I connect to is located. I'm pretty sure I've committed a crime, even if the computer providing the data is illegal, but is this only because the data was copied to my computer? If I use some VNC technology that shows me the screen of another computer located outside of the US to view this data without any of it stored or cached on my computer, am I still committing a crime (I think so?)
On the other hand I see servers located outside of the US doing things that would be illegal in the US, online gambling, 'spamming' people, selling things without paying US taxes etc. Can I connect to a server for any reason and still be legal? If amazon want's to have a server in some country X and pay that countries taxes instead of US taxes can someone from the US still connect to that server to do anything at all with it without suddenly being guilty of violating a law because that server isn't abiding by US law?
If it's the location of the user that matters then does that mean I can use a computer outside the US to do something that is illegal in that country? If I'm in the US and using a cloud computer hosted in say the UK and for some reason I end up doing something with that computer that is 100% legal in the US but isn't legal in UK (maybe some data is allowed to view here that isn't there?) have I broken the law in UK? If I happen to travel to UK at some later date could a zealous prosecute arrest me because of the location of my computer? (I realize this last question is probably comes down to "it depends on the country", but generally speaking for countries that practice common law is there a consensus that most countries agree on?)