Forum Discussion

Ken_Chan_95249's avatar
Ken_Chan_95249
Icon for Nimbostratus rankNimbostratus
Jun 27, 2008

HTTP::cookie problem

Hi all,

 

 

I have written the following code but I find that after I have insert the cookie in HTTP_Request event , it don't appear in the HTTP_Response event ,

 

 

 

when HTTP_RESPONSE {

 

set ip_ca [IP::client_addr]

 

if {not [HTTP::cookie exists "new"]}{

 

HTTP::cookie insert name "new" value "$ip_ca" path "/" domain ".domain.com"}

 

}

 

 

when HTTP_REQUEST {

 

set ip_ca [IP::client_addr]

 

if {not [HTTP::cookie exists "new"]}{

 

HTTP::cookie insert name "new" value "$ip_ca" path "/" domain ".domain.com"}

 

}

 

 

As I know , HTTP_Request should occur first but I don't know why when I try to log in both event, it shows me that both cookie insert are running each time and there is no value for the cookie "new" int he HTTP RESPONSE ..

 

 

Please give me some suggestion .. thx

 

 

Ken

 

 

 

1 Reply

  • What would you expect to see in the response?

     

     

    The server will receive the cookie, but why should it send ti back to the client?

     

     

    Should you wish your sever to send it back to the client, then you would need to get your server to 'SET' the cookie - or you set the cookie in your RESPONSE rule, and the client then sends it with each following requests automatically.

     

     

     

    Regards

     

     

    Andrew