I am having a strange problem with my login system that runs on Tomcat.

Here is what's happening:

User requests a resource. Each page includes a .jsp that checks to see if
they are logged. If they are, they get the resource. If not, I use
<jsp:forward> to send them to the login page.

The login page posts data to another .jsp. This .jsp checks their
credentials against the database. If they are correct a cookie is created,
they original resource loads. If not, they get the login screen again.

My problem is that the first time a user submits from the login HTML page to
the login.jsp page, the cookie isn't set. I can see that the other code
around it executes and no messages are generated by Tomcat... If I click
refresh and repost the form data, the cookie is displayed.

Am I doing something wrong? Can a page read a cookie from the browser if the
cookie was set by the page that forwarded to the requested resource?

Any help is appreciated.


Hunter Hillegas, MCP
Web Engineer / System Administrator - Jacob Stern & Sons, Inc.
[EMAIL PROTECTED]
805-565-1411 PH * 805-565-8684 FAX

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to