How do I prevent session hijacking by simply copy a cookie from machine to another?

It doesn’t make sense to “protect” against this. If this kind of copying happens, then either: The end user did it on purpose because they wanted to change computers. This is, of course, not something you should care about or be concerned about. An attacker has already compromised the user’s browser and gotten access to … Read more

Using Intellij to Build War and Deploy to Tomcat

Checklist of things you can do to verify where things go wrong: Manually build the artifacts using Build > Build artifacts. Verify if the artifact is in the expected output directory (out/artifacts/xxx). If not, go to File > Project structure > Artifacts Select the artifact file in question (project_name in this case). Verify if the … Read more

How to set a parameter in a HttpServletRequest?

You can’t, not using the standard API. HttpServletRequest represent a request received by the server, and so adding new parameters is not a valid option (as far as the API is concerned). You could in principle implement a subclass of HttpServletRequestWrapper which wraps the original request, and intercepts the getParameter() methods, and pass the wrapped … Read more

Cannot change version of project facet Dynamic Web Module to 2.5

short version Try this: Deselect the Dynamic Web Module in your project facets. Right click the Project -> preferences -> Project Facets Then run Maven -> Update Project again. Long Version I’ve had this problem a number of times while learning some eclipse dynamic web/spring stuff and none of the other solutions fixed my issue … Read more

What happens to JavaScript execution (settimeout, etc.) when iPhone/Android goes to sleep?

Looks like Javascript execution is paused on MobileSafari when the browser page isn’t focused. It also seems if setInterval() events are late, they are simply fired as soon as the browser is focused. This means we should be able to keep a setInterval() running, and assume the browser lost/regained focus if the setInterval function took … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)