|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Session ID problem (?)
I am working with sessions, which I don't have too much experience with
(yet). In trying to make sure my logout code works correctly, I am printing the session ID on each page I visit, before and after I log the user out. I have an index.html page which allows users to login or register. When they register, I put cookies on their machine to make it easier to log them in the next time they visit. When they login after the cookies are placed on their machines, the code automatically skips the login form and goes straight to the content the site provides. The problem seems to be that two separate session IDs are created, one by the "home" page (NOT index.html) and one by the remaining pages. Below is a trace of the pages I'm visiting in my test, with the session IDs associated with each. INDEX.HTML LOGIN.JSP Session ID : czyf9dp7.224f <<< LoginServlet >>> HOME.JSP Session ID : czyf9dp7.e83 (*) SETTINGS.JSP Session ID : czyf9dp7.224f FAQ.JSP Session ID : czyf9dp7.224f CONTACT.JSP Session ID : czyf9dp7.224f HOME.JSP Session ID : czyf9dp7.224f (#) LOGOUT.JSP Session ID : czyf9dp7.224f < old session was invalidated here > INDEX.HTML LOGIN.JSP Session ID : czyf9dp7.6a03 <<< LoginServlet >>> HOME.JSP Session ID : czyf9dp7.72a9 (*) SETTINGS.JSP Session ID : czyf9dp7.6a03 FAQ.JSP Session ID : czyf9dp7.6a03 CONTACT.JSP Session ID : czyf9dp7.6a03 HOME.JSP Session ID : czyf9dp7.6a03 (#) What's really odd is that the first time the home.jsp page is visited (*), it's ID is different from the others, but the second time (#) it matches. Each JSP has the session page directive set to true. Also, the code that checks the login information is a servlet. Any ideas? Bob |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Session ID problem (?) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|