$this->session->set_userdata('url11',"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
This it will work 100% use any variable in place url1
by which you can take it at place in application and write this thing in header of the view page in php tag.