JSP Session var values lost

Discussions

EJB design: JSP Session var values lost

  1. JSP Session var values lost (2 messages)

    In the webpage i'm creating using JSP and struts the session variable value is getting lost for only one page alone. All the other pages its retaining. I'm actually using the variable to hold the user_id. so that whenever a link is clicked to enter a new page i'm validating it to check if the user is valid.

    Now the problem is for one page alone the value is getting lost.

    session = request.getSession(false);

    This is the line i'm using to create the session instance and then i'll use session.getAttribute to get the value. Now why it is not retaining in that page alone, i'm not able to unserstand. Is there any other solution to maintain.I'm using Struts,JSP and Tomcat. Please Help.

    Threaded Messages (2)

  2. JSP Session var values lost[ Go to top ]

    what happens when you just do..

    session = request.getSession();

    ?

    i believe (if memory serves me correctly) there's also jsp page directives that you can tell not to use sessions..

    hope that helps,

    www.binaryfrost.com
    In the webpage i'm creating using JSP and struts the session variable value is getting lost for only one page alone. All the other pages its retaining. I'm actually using the variable to hold the user_id. so that whenever a link is clicked to enter a new page i'm validating it to check if the user is valid.Now the problem is for one page alone the value is getting lost.session = request.getSession(false);This is the line i'm using to create the session instance and then i'll use session.getAttribute to get the value. Now why it is not retaining in that page alone, i'm not able to unserstand. Is there any other solution to maintain.I'm using Struts,JSP and Tomcat. Please Help.
  3. Check timeout setting....[ Go to top ]

    1. Check timeout setting of your app. If timeout, you lose session attributes

    2. Check if session.invalidate() has been called somewhere else.

    Bottomline, you lost session attribute because you are getting a different session object.