tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mike jackson" <mjack...@cdi-hq.com>
Subject RE: Sessions NOT Maintained
Date Tue, 22 Apr 2003 00:01:35 GMT
Using IE6?  Check the privacy tab...  

--mikej
-=------
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Hari Om [mailto:hari_om@hotmail.com]
> Sent: Monday, April 21, 2003 1:21 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Sessions NOT Maintained
> 
> Hello Everyone!
> 
> I am using Servlets, JSP and JDBC for my Web Application.
> 
> I am using SESSION Variables. My entry point is Login Screen
> "www.man.com/proj/servlet/login" where user enters USERNAME/PASSWROD.
> 
> This FORM calls PROCESS.JAVA Servlet which creates a SESSION for them
as
> shown:
>
-----------------------------------------------------------------------
> HttpSession session = req.getSession(true);
> String uname = (String)session.getValue("uname");
> 
> // code coonects to JDBC and see if they match
> // IF MATCH
> 
> session.putValue("uname",req.getParameter("username"));
> String uid = "";
> uid = uid.valueOf(rs.getInt("uid"));
> session.putValue("uid",uid);
> 
> //I then redirect to MENU Page ....which list options availabe for
this
> user.
> res.sendRedirect(menuURL);
> ---------------------------------------------------------------------
> 
> on my menu page (MENU.JAVA), I have following:
> -----------------------------------------------------------------
> HttpSession session = req.getSession(true);
> String uname = (String)session.getValue("uname");
> String uid =   (String)session.getValue("uid");
> 
> if (uname == null)
> {
> 	PRINT ERROR.....
> }
> -----------------------------------------------------------------
> 
> Later then user selects one of the MENU options and it takes to
another
> Servlet (say OPT1.JAVA)...
> 
> OPT1 Servlet is processed and at the end it displays a LINK which will
> take
> a User back to MENU.JAVA Page....
> 
> But When users clicks this LINK (A HREF) it takes to MENU.JAVA Page
but
> shows UNAME as NULL...... How is it possible...? SHOULD IT NOT RETAIN
the
> SESSION....?
> 
> HOW CAN I RETAIN my PREVIOUS Session Variables...?
> 
> Any related informaiton on this is appreciated.
> 
> THANKS!
> 
> 
> 
> 
> 
> 
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message