As this query is tagged as PHP so assuming that you are talking about PHP session hijacking.
Session hijacking is a term that is used to describe a method for obtaining a user's PHPSESSID. When a user logs into a PHP application, the browser will store a hash string value like'525cc0036c99f013bd17b7b91233fae4'. The same hash string matches the stored session on the server. There are several ways the user can get your sessions; such as sniffing it out on a shared network with software like 'Wireshark'. Another method is to just get the id from a public computer and manually recreate it in another browser. The whole idea here is that if the browser PHPSESSID and the server session id will match, any user can make the website believe that you are authenticated.
As a programmer, there are several safeguards you could use to your scripts to ensure that the PHPSESSID in your browser is not so usable elswhere. You can set a session variable as your ipaddress with $_SERVER[‘REMOTE_ADDR’]. For example, $_SESSION[ip_address'] = $_SERVER[‘REMOTE_ADDR’]. Now, you can run the following code to make sure the session IP is the same as the computer ip address. (though text is copied but we follow the exact model at QueryHome)
if($_SERVER[‘REMOTE_ADDR’] != $_SESSION[ip_address'] ){
die();
}
Credit: http://lampload.com/PHP-Session-Hijacking.html