Forum Discussion

Beinhard_8950's avatar
Beinhard_8950
Icon for Nimbostratus rankNimbostratus
Nov 22, 2011

Redirect based on URL, Cookie problem.

Hi,

 

 

I have a VS that has it´s default pool.

 

The VS has cookie insert has persistence.

 

 

I have made a "redirection" based on a Uri with this Irule.

 

 

when HTTP_REQUEST {

 

if { [string match "*/xxxxxxxxx/yyyyyy*" [string map {. ""} [HTTP::request]]] } {

 

pool xxxyyyy

 

} else {

 

pool default

 

}

 

}

 

 

So the client flow is this:

 

 

The Client goes to the vs, authenticated and are logged in.

 

They have got the cookie (traffic flows to a node in default pool).

 

when they go to am speciell link at the site they will hit the irule and can then upload a document (pool xxxyyyy.

 

 

The problem is that when they "go back" (uploaded the file is done) to the default pool the cookie value has changed becasue they have visiting the pool "xxxyyyy so now they don´t hit the webserver they where on before.

 

Persistency has failed so the user is logged out.

 

 

 

How can I fix this?

 

 

ps. persistency on the pool xxxyyyy is not mandatory but can be an option.

 

 

Regards,

 

 

Beinhard

 

  • Since persistence is not mandatory on pool xxxyyyy, why won't you use persist none when selecting pool xxxyyyy?
  • hmm, but the Cookie is inherited from the VS, not pool, and I can´t removed it because i need the cookie when the client go back to the default pool.

     

     

    So how do you mean by "use persist none", additional text in in Irule?

     

     

    Regards,

     

     

    Adam

     

  • e.g.

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       persist cookie
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
            if {[HTTP::uri] equals "/test"}{
                    pool foo2
            } else {
                    pool foo
            }
    }
    }
    
    [root@ve1023:Active] config  curl -I http://172.28.19.79/
    HTTP/1.1 200 OK
    Date: Tue, 22 Nov 2011 16:32:10 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
    ETag: "4183e4-3e-9c564780"
    Accept-Ranges: bytes
    Content-Length: 62
    Connection: close
    Content-Type: text/html; charset=UTF-8
    Set-Cookie: BIGipServerfoo=1707657416.20480.0000; path=/ <<<<<<<<<<
    
    [root@ve1023:Active] config  curl -I http://172.28.19.79/test
    HTTP/1.1 404 Not Found
    Date: Tue, 22 Nov 2011 16:31:31 GMT
    Server: Apache/2.2.3 (CentOS)
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    Set-Cookie: BIGipServerfoo2=1724434632.20480.0000; path=/ <<<<<<<<<<
    
    
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
            if {[HTTP::uri] equals "/test"}{
                    persist none <<<<<<<<<<
                    pool foo2
            } else {
                    pool foo
            }
    }
    }
    
    [root@ve1023:Active] config  curl -I http://172.28.19.79/
    HTTP/1.1 200 OK
    Date: Tue, 22 Nov 2011 16:33:06 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
    ETag: "4183e4-3e-9c564780"
    Accept-Ranges: bytes
    Content-Length: 62
    Connection: close
    Content-Type: text/html; charset=UTF-8
    Set-Cookie: BIGipServerfoo=1707657416.20480.0000; path=/
    
    [root@ve1023:Active] config  curl -I http://172.28.19.79/test
    HTTP/1.1 404 Not Found
    Date: Tue, 22 Nov 2011 16:32:17 GMT
    Server: Apache/2.2.3 (CentOS)
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    
    
  • Verified now in test and yes, it's seems to work as expected =)

     

     

    However, if I want to to maybe insert a cookie insert like this:

     

    persist cookie insert xxxyyyy "0d 00:00:00"

     

    It seems that my test F5 was affected by the SOL11679 and 13069.

     

     

     

    I haven´t had the time to dig in to it yet but it seems that I didn´t got the session expire.

     

     

     

    Beinhard

     

     

     

  • It seems that my test F5 was affected by the SOL11679 and 13069.doesn't the workaround work??
  • I was a little bit stressed so when I did the cookie insert and saw that the cookie had a Timeout of 180 s is thought, wtf but after a little time I thought I was hitted by a bug and when I saw these two SOL everything cleared.

     

     

    I verifed it today and it was OK, workarounds usually works.

     

     

     

     

     

    Beinhard