Hi, i played around a little bit with the sample loggin application. i
have setup this interceptor:
public void function preProcess(event,struct interceptdata){
var rc = Event.getCollection();
var loggingIn = false;
var oSession = getPlugin("SessionStorage");
if(event.getCurrentEvent() == "General.doLogin"){
loggingIn = true;
}
if((!oSession.exists("loggedin") or !oSession.getVar("loggedin"))
and !loggingIn){
Event.overrideEvent("General.displayLogin");
getPlugin("MessageBox").setMessage("warning", "Benutzersitzung
wurde verloren. Bitte neu anmelden.");
}
}
my session timeouts fast
<cfset this.sessionTimeout = createTimeSpan(0,0,1,0)>
This is my form (shorted)
<form name="loginform" action="#event.buildLink('general.doLogin')#"
method="post">
and this is the event (shorted)
public void function doLogin(event){
var rc = event.getCollection();
if(!event.valueExists("username") or !
event.valueExists("password")){
//doSomething
}
else{
UserService =
createobject("component","webapp.model.UserService").init();
User = UserService.getUser(rc.username,rc.password); //returns
an object or false
if(isObject(User)){
getPlugin("SessionStorage").setVar("loggedIn",true);
getPlugin("SessionStorage").setVar("User",User);
setNextEvent("General.displayHome");
}
else{
getPlugin("MessageBox").setMessage("error","Ungültiger
Benutzername oder Passwort.")
setNextEvent("General.displayLogin","username=#event.getValue("username","")#");
}
}
I can login but when the session timesout and i i refresh the site
I get an Exception: No matching Method/Function for
String.GETINSTANCE() found
caused by this line
<td><p>Willkommen zurück
#getPlugin("SessionStorage").getVar("User").getInstance().firstname#!!!
</p>
Of course, the session is dead, there is no User object anymore. But
why does the interceptor not intercept