Hi Andy, The servlet API does use cookies for sessions. Keep in mind that an HTTP "session" isn't really a session at all because there's no true stateful connection in place over HTTP. Although your web/app server will remember a session, a browser/client will not. You can choose to not utilize cookies, and maintain a session, by always passing your session ID around within your program. See Priscilla's email.
-B >>> [EMAIL PROTECTED] 11/29/02 12:47PM >>> Becky, Thanks for your reply. My browser didn't accept cookies. I enabled them. Please correct me if I am wrong! I was under the impression that Session Management using Servlets API does not require the use of cookies. I thought Session Tracking using URL Rewriting, Using Cookies and Using Hidden Form Fields were old methods of session tracking and servlet API was designed so that one can do session management without having to use any of these. Is that true? If yes, why would I require to enable cookies in order to run my code? Thanks for the help! --Andy. Becky Phaneuf <[EMAIL PROTECTED]> wrote:Andy, Does your browser accept cookies? If not, turn on the acceptance of cookies b/c the session object makes use of them to "remember" itself. You have to first retrieve the session, then retrieve the object from it. Did you do that? I would assume this is your code: setting: HttpSession sessionName = requst.getSession(); sessionName.setAttribute("objectName", someObject); getting: HttpSession sessionName = request.getSession(); someObject objectName = (someObject) sessionName.getAttribute("objectName"); If not, fix your code. It's possible to maintain a session w/out cookies, but you'll have to look that up yourself. :) -B >>> [EMAIL PROTECTED] 11/29/02 07:32AM >>> Frans, Thanks for your reply. It is in the same servlet context. Are you saying that it is in the same directory? All my files are in the same directory. However, I do have my classes and the web.xml file stored in the WEB-INF directory within my main application directory. Any suggestions or ideas that I could possibly try? Thanks! --Andy. Frans Verhoef wrote:Andy, Is the page to which you are redirecting a servlet inside the same ServletContext. A session can only be used from within the same ServletContext, i.e. the web application directory. Frans On 27 Nov 2002 at 22:19, Aasim wrote: > > Dear Servlet-interest users: > I am new to servlets and I need your help.I am having a problem with session >management. I add > an object to a new HTTP session ina servlet class. Then I redirect my servlet to >another page. I > need to access the originalobject that I previously addedon this page, which is a >new class. > When I try to retrieve the original object from another class using getAttribute(), >it gives me anull > value. Can this be done? Am I doing something wrong over here or am I missing >something? > Thanks for the help in advance. > Sincerely, > --Andy. > > > > > > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now ====================================================== Tel: +65 68741415(office) / +65 64670239(home) / +65 98484325(hp) Email: [EMAIL PROTECTED] Website: http://www.travel-companion.net ====================================================== ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html