A little more info would be good... how are you
testing this? I mean, what client browser are you using, and how is it configured?
I once had a similar issue, and discovered that my Firefox browser was set to dump all cookies at end of session.
I recommend that you check your browser *during* the session to see if the cookie is being set as you expect, and then recheck in a new session to see if it has actually persisted the cookie.
Unfortunately, UBB doesn't allow me to show you the address bar javascript to reveal cookies in an alert dialog, but it isn't hard to figure out: its an alert with the document cookie object as the argument.
If you limit your detective work to the server-side, then you may be missing something simple.
If you aren't seeing what you expected, then check your browser's cookie acceptance policy.
Depending on the development tools that you have, you may also have an HTTP monitor available to you. Netbeans has one, and I'm pretty sure there is a similar function in Eclipse.
Hope this help!