I'm working on a web application with spring mvc
. I put profile data about my users in a session
variable.
for( AdminProfil ap : admin.getAdminProfils()){
if(ap.getProfil().getNomProfil().equals("root")){
session.setAttribute( "root", true );
}
else if(ap.getProfil().getNomProfil().equals("saisie")){
session.setAttribute( "saisie", true );
}
else if(ap.getProfil().getNomProfil().equals("controle")){
session.setAttribute( "controle", true );
}
else if(ap.getProfil().getNomProfil().equals("validation")){
session.setAttribute( "validation", true );
}
}
and in my jsp
page :
<c:if test="${ sessionScope['saisie'] }">
......
</c:if>
- I want to know if the
session
variable can be modified by one of my users or someone else who wants to hack my web application? - If the session can be modified what other solution can I use to stop a user from changing their profile?
- Is it okay to use a session variable in my case or are cookies better?