Forum Discussion
dragonflymr
Nov 20, 2015Cirrostratus
iRule to store cookie in table
Hi,
I am really iRule novice and so any advice, pointing in right direction will be of great help for me. I am short on time and have to create iRule with following logic:
Service behind F...
Stanislas_Piro2
Nov 20, 2015Cumulonimbus
You can try with this irule (not tested) to begin...
when HTTP_REQUEST {
switch [HTTP::path] {
"/img/logo.png" -
"every-file-used-in-auth-page" -
"/login.php" {
return
}
default {
if {([HTTP::cookie exists "mycookie"]) && ([table lookup -subtable "authent" [HTTP::cookie value mycookie]] != "")} {
return
} else {reject}
}
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "mycookie"] } { table add -subtable "authent" [HTTP::cookie value mycookie] "logged" indef 2400
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects