irule to popup the message before continue to page.
i have a below irule to popup the message window before to continue to the page. there are two issue what i don't know how to correct it.
- the message doesn't go away after 5 seconds to the page www.abc/def.
- The message is not popup again after the first time to enter the page www.abc/def. I have to clear the cache to popup the message again when go to other page www.abc/xyz.
Any help i appreciate it.
The below is irule:
when RULE_INIT {
set static::refresh_time 5
set static::notification_page {
System Notification
Bookmark the new home: http://www.abc.com/home.
This message will close in $static::refresh_time seconds to continue.
}
}
when HTTP_REQUEST {
if { ( [HTTP::uri] eq "/def.html") and (not [HTTP::cookie exists NotificationDone]) } {
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" Set-Cookie "NotificationDone=1; path=/; domain=.[HTTP::host]"
}
elseif { ( [HTTP::uri] eq "/xyz.html") and (not [HTTP::cookie exists NotificationDone]) } {
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" Set-Cookie "NotificationDone=1; path=/; domain=.[HTTP::host]"
}
}