Forum Discussion
Nicolas_Menant
Employee
Mar 31, 2008Session command and any virtual ...
Hi,
i faced an issue when trying to share session data between VS:
here was my code:
when HTTP_REQUEST {
if {[session lookup uie {[IP::client_addr] any virtual}] eq ...
Nicolas_Menant
Employee
Apr 07, 2008Hi,
it seems to be an expected behavior ...
Here is the response coming from support:
The session command expects all of the data and associated "any virtual" commands to be a single argument; in other words, a list.
The documentation uses the most obvious and straight forward way of creating a list, which is to use curly braces ( {} ). However, Tcl deliberately does not expand variables inside curly braces, so the session command as it is written does not add the IP address as the key.
See http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=120 for additional details on TCL and braces..
There are two ways to make this work. The first is to use the "list" command to create the list:
set slist [list [IP::client_addr] any virtual] session lookup uie $slist
The second way is to use a string and let Tcl promote it to a list. This is what you are doing when you set the variable.
session lookup uie "[IP::client_addr] any virtual"
HTH
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