Is it possible to programmatically authenticate with Spring

I’m using the following method in a Spring Controller to allow authentication via Ajax. It works, but it doesn’t seem to create a cookie or anything that makes the authentication persistent.@RequestMapping(method...