I am working on a session for my site but I keep getting errors on compile. See code below:
Hi buddy! I guess you have two problems here. First one is "(long)". You can't use primitive types for casting objects. Second one, i guess, is that your code will call session.getAttribute("userid") even if your session happens to be null. response.sendError(501) will not return you from method. It'll just set a header with error status instead and you'll probably get a null pointer exception.
If you think you've done too much, usually it means you've done too few.