For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

scorpa_121336's avatar
scorpa_121336
Icon for Nimbostratus rankNimbostratus
Jul 09, 2013

Persistance based on session ID in URI

Hello!

Could you provide me some guidance of how to do this thing:

1. Client initiate session to server

2. Server create session for client and put in URI like www.example.com/blahblah!SessionID/blahblah

3. Client must be redirected to server according to sessionID in URI

I have configuration from apache that working and now need to rewrite it on irule:

stick-table type string len32 size 20k expire 60m store http_req_cnt

stick store-response hdr(E-Session)

stick match path_between(!,/)

server server1

server server2

So as i understand i need to do something like that:

when HTTP_RESPONSE {

 if {  match path between (!) and (/) for session id

set session_id matched session id

  }

default {

set session_id ""

}

}

when HTTP_REQUEST {

if ( $session_id ne""}{

persist uie $session_id 3600

}

}

4 Replies

  • Numbers 1 and 3 are pretty straight forward, but how will the URI present itself to the client in the response (2)? In the payload as (multiple?) links? A redirect? A header? A cookie?
  • That sessionID should be in response http header called - E-session. But the problem is - how to match path between two characters?
  • Ahh, well to extract a string from another string based on known delimiters, you may find the findstr function useful. ;)

     

     

    So assuming the SessionID is in the URI:

     

     

    set sessionid [findstr [HTTP::uri] "!" 1 "/"]