HttpSession is not returning a null sesion in JSP? -
i want enter page when provide proper authentications able access page url of page well. please check mistake
<%@ page session="false" %> <% if(request.getsession(false)!=null) { string name=(string)session.getattribute("name"); string path=(string)session.getattribute("dp_path"); string profile_id=(string)session.getattribute("profile_id"); %> %html% <% } else { out.println("<font color=red size=4>you not logged in</font><br>please " + "<a href=index.jsp>login</a> access page"); } %>
what should make correct?
you should check user authenticated. not there session. 2 facts unrelated: can have session if user not authenticated.
put information in session after authentication distinguish sessions of authenticated visitors sessions of non-authenticated visitors.
Comments
Post a Comment