Forum Discussion
Irule Example Issue
- Jul 25, 2023
tfinkelstein Does the end user receive any sort of cookie once they have successfuly logged into the system? If so you can configure an iRule to redirect to /login when only / is found and when a specific HTTP header such as a login cookie isn't in the HTTP header but if it is then just send the user to /home. Please keep in mind that the F5 would not be validating the HTTP header value against any sort of user login even and would just be a search for value and perform said action. It would be up to the receiving server to validate that the user did log in and the HTTP value they provide is for the user session.
- Jul 25, 2023
Paulius has a good point, if you know the name of the cookie being set by the application upon successfull login, you have have logic similar to the following:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } HTTP::redirect "https://[HTTP::host]/login" } if { [HTTP::cookie exists "nameofcookie"] } { HTTP::redirect "https://[HTTP::host]/home" } }
tfinkelstein Does the end user receive any sort of cookie once they have successfuly logged into the system? If so you can configure an iRule to redirect to /login when only / is found and when a specific HTTP header such as a login cookie isn't in the HTTP header but if it is then just send the user to /home. Please keep in mind that the F5 would not be validating the HTTP header value against any sort of user login even and would just be a search for value and perform said action. It would be up to the receiving server to validate that the user did log in and the HTTP value they provide is for the user session.
- whispererJul 25, 2023MVP
Paulius has a good point, if you know the name of the cookie being set by the application upon successfull login, you have have logic similar to the following:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } HTTP::redirect "https://[HTTP::host]/login" } if { [HTTP::cookie exists "nameofcookie"] } { HTTP::redirect "https://[HTTP::host]/home" } }
Recent Discussions
Related Content
* 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