Cannot get Session Object in JSP
In my global.jsp file on line 44 I have
I want to try use session such as
session.setAttribute(userIDKey, userID);
on a jsp page.
in global.jsp I have
--%><%@page session="false" import="javax.jcr.*,
If I change it to
--%><%@page session="true" import="javax.jcr.*,
then every page I try display give
/libs/foundation/global.jsp(44,4) Page directive: illegal to have multiple occurrences of session with different values (old: false, new: true)
else
If I leave global.jsp with
--%><%@page session="false" import="javax.jcr.*,
And I try enable session on my jsp page
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/libs/foundation/global.jsp"%>
<%@page session="true"%>
I get
org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: /apps/components/comps/compponentexample/compponentexample.jsp(3,0) Page directive: illegal to have multiple occurrences of session with different values (old: false, new: true)
Is there a way to be able to use session object in aem 6.1