Is there a way that I can run a piece of code before a session is created. In this situation, I would like to determine whether or not a session has been created for this user or not, and if not do something, and if so, do something else.
//Sudo code.
if(session.exists){
doSomething();
}elseP
createSession();
fillSessionWithValuesOnlyOnCreation();
otherLogic();
}
The thing is, Sessions seem to be created before I can make the check to see if the session exists, I've thought aabout checking the creation time and comparing it to current time, but I was curious if there is a better and more reliable way of doing it. I'm aware of a listener that can be triggered on session creation, but I'm not sure if it will have the request info I 'll need to populate the Session. And also not sure the order of executions, and if that listener will be triggered before filters execute.