Hi all :
 
I wanted to write a mod URL rewrite program.
 
I wanted to append session ID to the tail of all the urls of a website.
 
For instance when i access url http://www.nus.edu.sg?sessionid=dfd3453
i want all the urls to be appended in all the urls of that website..
 
My qns is everytime i found that the session id is lost... through the many requests and responses.
And the new url does not reflect on the client browser..
 
Any one got any idea.. what wrong with my program??
 
Thanks for your help...
 
sub handler {
   
     my $r = shift;
     my $url = $r->uri;
     my $sessID;
    
     if($url =~ m/sessionid/){
          $sessID= getSessionID($url);
     }
 
     my $append =?sessionid=$sessID
     my $newURL = $r->uri($url$append);
 
     return DECLINED;
 
}
 
sub getSessionID{
     my  $url = $_[0];
     my  $position = rindex($url,"=")+1;
     my  $sessID = substr($url,$position,8);
     return $sessID;
 }
 
Regards
kheeteck
 
 
 
 
 

Reply via email to