Hi User 1115,
I think the issue might be in the logic of what are yo trying to do.
According to your iRule the logic works like this:
If client ip matches the class_ip datagroup, apply the Cookie Insert and then EXIT the iRule. (NOTE: It will not evaluate the rest of the iRule)
If client ip does not match the class_ip datagroup, and if the uri starts with "/clasee" then go to pool called class and EXIT the iRule. (NOTE: No Cookie Insert will be invoked)
If client ip does not match and your URI does not start with /clasee then go to pool main and EXIT the iRule. (NOTE: No cookie Insert will be invoked)
Is this logic you want?.
Bhattman