Thanx for the help.
I don't have custom trigger, I just check if I have cookie set and if the user is not logged in (that part is not working). If I have cookie I wanted to use the behaviour to set 3 session variables from the DB.
If I do not use your rule for logged in customer, but let's say check if the customer is logged like session("CustomerID")<>"" then... the script works. I wanted to use your trigger (the log in customer one).