A session is set, a value assigned to that session - no syntax or declaration errors. Sesions enabled - all bases covered? // sample. session.setAttribute("userID","1"); Why would that session read null on another page 5 seconds later?
are you sure you have cookies enabled? many app servers track your browser through cookies... if you've disabled, them it will give you a new session ID the next page iteration. Also, print out the session ID on each page and see if it changes -- then you know WHY your session is empty on the next page... now you just need to figure out why the session isn't being tracked from page to page.