@iRuleYou - below is:
1 - the persistence cookie definition:
ltm persistence cookie persist_Test {
app-service none
cookie-encryption required
cookie-encryption-passphrase $M$jb$wzkKy+0kkZgRly/uKWOlcQ==
cookie-name Test
defaults-from /Common/cookie
timeout 180
}
2 - iRule i'm using for testing:
when CLIENT_ACCEPTED {
set encryption_passphrase "7618"
set cookiename "Test"
}
when HTTP_REQUEST {
if {[HTTP::cookie exists $cookiename] } {
set encrypted [HTTP::cookie $cookiename]
set decrypted [HTTP::cookie decrypt $cookiename $encryption_passphrase "192"]
if { ($decrypted eq "") } {
log local0. "Cookie NOT DECRYPTED Properly !!!!"
}
log local0. "Cookie: Encrypted -> $encrypted, Decrypted -> $decrypted"
}
}
when HTTP_RESPONSE {
set $pcookie "123456"
HTTP::cookie insert name $cookiename value $pcookie path "/"
HTTP::cookie encrypt $cookiename $encryption_passphrase "192"
}
Right now i can decode the cookie properly, but when i'm encrypting my cookie from iRule then i can't decrypt it properly.
Thanks for any hints on it.