All good points from Jens.
But, perhaps I'm missing something, but on most servers (Apache with mod_php, Tomcat) set a session token in the cookie on the first request you make to the server. Once the user logs in, you associate this session with that user by persisting their data data in $_SESSION or a session scoped bean. To that end, if you had your app open in one window, or 10 windows, they should all be on the same session because they are all passing the same session id cookie.
Assuming that you're doing that, then a mechanism like Spring Security that would allow you to secure a context like "**/secure/*" to a given role (i.e. User) would be all you needed to do to protect your services/RPC's
The one catch is application timeout. To get around this I return an HTTP error code (i.e. forbidden) and then have that caught in the failure handler for the RPC's. I extended the typical callback handler so all RPC's can handle session termination in a consistent, graceful way, prompting them to login again. With Spring Security you can even setup the request to us remember me cookies (if user selected that on login). In that case the server will cache the request, log the user back in, and forward the request, making the session timeout/relogin invisible to the user.
Hope that helps.
Sincerely,
Joseph