Sneha Sharma@CONTEXT
08/09/2000 02:49 PM

We faced similar problems
And the soln is to make cookie addn the first step on any  page.
I mean response.addCookie has to be  the 1st statement on a page b4 any
other part of the page is rendered.
Ciao,
Sneha




Hunter Hillegas <[EMAIL PROTECTED]> on 08/09/2000 05:09:41 PM

Please respond to A mailing list about Java Server Pages specification and
      reference <[EMAIL PROTECTED]>



 To:      [EMAIL PROTECTED]

 cc:      (bcc: Sneha Sharma/Context)



 Subject: Problems with my Login System... JSP and Cookies









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

===========================================================================
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