bilbo010
asked on
session variables
Hi
I have a jsp login page with a basic structure of:
Enter password and userName
if (password == password in data base){
set session variable
}
if session variable set{
display menu of site links
}
Could someone please explain how you set the session variable. And check for it in this and other site pages.....
Many Thanks in advance
I have a jsp login page with a basic structure of:
Enter password and userName
if (password == password in data base){
set session variable
}
if session variable set{
display menu of site links
}
Could someone please explain how you set the session variable. And check for it in this and other site pages.....
Many Thanks in advance
ASKER
Hi
thanks for the help am getting this error
in javax.servlet.http.HttpSes sion cannot be applied to (java.lang.String,boolean)
session.setAttribute("islo gin", true);
Thanks
thanks for the help am getting this error
in javax.servlet.http.HttpSes
session.setAttribute("islo
Thanks
ASKER
Hi
thanks for the help am getting this error
in javax.servlet.http.HttpSes sion cannot be applied to (java.lang.String,boolean)
session.setAttribute("islo gin", true);
Thanks
thanks for the help am getting this error
in javax.servlet.http.HttpSes
session.setAttribute("islo
Thanks
ASKER
Hi
thanks for the help am getting this error
in javax.servlet.http.HttpSes sion cannot be applied to (java.lang.String,boolean)
session.setAttribute("islo gin", true);
Thanks
thanks for the help am getting this error
in javax.servlet.http.HttpSes
session.setAttribute("islo
Thanks
ASKER
Hi
thanks for the help am getting this error
in javax.servlet.http.HttpSes sion cannot be applied to (java.lang.String,boolean)
session.setAttribute("islo gin", true);
Thanks
thanks for the help am getting this error
in javax.servlet.http.HttpSes
session.setAttribute("islo
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
session.getValue is deprecated. your need
session.getAttribute(), it also may be easier to save username in the session so you can check who is logged on later:
session.setAttribute( "loginUser", username )
if( session.getAttribute( "loginUser" ) != null )
you can also retrieve back username in other page:
String username = (String) session.getAttribute( "loginUser" );
session.getAttribute(), it also may be easier to save username in the session so you can check who is logged on later:
session.setAttribute( "loginUser", username )
if( session.getAttribute( "loginUser" ) != null )
you can also retrieve back username in other page:
String username = (String) session.getAttribute( "loginUser" );
ASKER
sorry for the delay few other things to sort thanks all
session.setAttribute("isLo
and in the other pages do:
if(session.getValue("isLog
response.sendRedirect("log
Hope that helps!