Forum Discussion

jay_41157's avatar
jay_41157
Icon for Nimbostratus rankNimbostratus
Sep 19, 2008

Cookies shared between subdomains..pointing to same VS

HI,

 

 

Here is what I have...

 

 

A.domain1.domain.com --->>>>> points to VS say 1.1.1.1

 

B.A.domain1.domain.com --->>>>> also points to the above VS 1.1.1.1

 

 

http persistance is cookie.

 

 

When a user login to the system using A.domain1.domain.com the F5 sets a cookies for this user and it uses this cookie to stick the user to a particular server say server 1; and that works fine.

 

 

Lets say now the user accesses the B.A.domain1.domain.com site and it is required that are also kept to the same server as the A.domain1.domain.com (server1 from above).

 

 

 

Any thoughts ? thanks

1 Reply

  • You can set the domain on the persistence cookie using a rule:

    This rule assumes you're using the default persistence cookie name (BIGipServerPOOLNAME). If you've customized the cookie name in the persistence profile you could hardcode it in the rule and remove the LB_SELECTED event.

    http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=1133611608

     
     when LB_SELECTED { 
         get the pool name used for this request 
        set my_pool [LB::server pool] 
     } 
     when HTTP_RESPONSE { 
      
         Check if the persistence cookie exists in the response 
        if {[HTTP::cookie count] > 0 and HTTP::cookie exists "BIGipServer$my_pool"} { 
      
            set the domain attribute on the persistence cookie to .example.com. 
           HTTP::cookie domain "BIGipServer$my_pool" ".example.com" 
         
     } 
     

    Aaron