Q:

Solution for passing tokens from iframe HTML

I'm in a bit of a pickle. Using Java and Tomcat 7 container as a webapp. We pass around tokens everywhere in our application (for security when in session a user is assigned a token and appended to the end of the URL).
However we currently have a window (which contains the token in the URL) that opens another html in an iframe. Within this html is a link to another section of the website, how can I retrieve the token from the HTML if it's unavailable at the time? What might be the least messiest solution, JavaScript in the HTML to get the token from the browser and then append it to the end of the link?

A:

Save the token as a cookie. The cookie is sent along with each request to the server. Once set, it is available on the server side and can be accessed with javascript on the client side.

