Results 11 to 18 of 18
-
23rd Aug 2010, 01:27 PM #11OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comyea VB / PHPBB they have Session Fixation Implemented already, this mainly for personal apps you create.
Another method that i would bet face-book's code goes along is something like this .
PHP Code:$timeout = 60 * 60; // 1 hour
$fingerprint = md5('MY-SECRET-SALT'.$_SERVER['HTTP_USER_AGENT']);
session_start();
if(
(isset($_SESSION['last_active']) && (time() > ($_SESSION['last_active']+$timeout)))
|| (isset($_SESSION['fingerprint']) && $_SESSION['fingerprint']!=$fingerprint)
|| isset($_GET['logout']) )
{
//Logout!
}
session_regenerate_id(); //ALWAYS BEFORE
$_SESSION['last_active'] = time();
$_SESSION['fingerprint'] = $fingerprint;
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
24th Aug 2010, 09:46 AM #12MemberWebsite's:
Doxsters.netAnother way is to create a database with session keys and IP's or maybe IP ranges? Then, check whether the session id and IP match up. If not throw an error, etc
Need a Designer/Web Developer? Click Me
MSN: PM me for it.
Email(Preferred):timtamboy63@gmail.com
"Power Corrupts. Absolute Power Corrupts Absolutely"
-
24th Aug 2010, 09:48 AM #13OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comyea tam that's usually how forum systems like to handle it, the exact same method but different storage method thats all
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
24th Aug 2010, 03:45 PM #14MemberWebsite's:
Doxsters.netoh cool, i didnt know that, how do they store it?
Need a Designer/Web Developer? Click Me
MSN: PM me for it.
Email(Preferred):timtamboy63@gmail.com
"Power Corrupts. Absolute Power Corrupts Absolutely"
-
24th Aug 2010, 03:55 PM #15MemberWebsite's:
gudz.org
-
24th Aug 2010, 10:27 PM #16OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comthanks
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
24th Aug 2010, 10:44 PM #17MemberWebsite's:
pspmafia.com zrev.netGah! Always forget to do this *smh* thanks for reminding me for my new script
Trusted & Respected Members:
ACiD | Narutoroot | JmZ | Jackson | Phamous | litewarez
-
24th Aug 2010, 10:54 PM #18OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comYea heres an example of it in action in LitePHP witch i now use for anysite or system i create
PHP Code:<?php
class Library_session
{
private $_session = array();
public $_core_timeout = 600; //10 Minuetes (Sufficiant ?)
function __construct()
{
if(!session_id())
{
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(0, '/');
//Prevent session hijacking by regeneration!
session_regenerate_id();
session_start();
}
$this->_session =& $_SESSION;
//Scan the suer agent to prevent session hijackin
$this->checkHijackAttempt();
}
private function checkHijackAttempt()
{
if(isset($this->_litephp_security))
{
if($this->_litephp_security != md5($_SERVER['HTTP_USER_AGENT']) || $this->_litephp_security_t < (time() + $this->_core_timeout))
{
unset($this->_session);
unset($_SESSION);
session_destroy();
}
}else
{
//As the session is fresh we create a UA hash!
$this->_litephp_security = md5($_SERVER['HTTP_USER_AGENT']);
}
$this->_litephp_security_t = time(); //Timeout
}
//Usage $this->Library->Session->some_var('trim',array('Library_user','check_id')); //will trim and get the returned value from 2nd funtion
function __call($key,$args)
{
if(!isset($this->_session[$key]))
{
return false;
}
$return = $this->_session[$key];
foreach($args as $func)
{
if(is_callable($func))
{
$return = call_user_func_array($func,$return);
}
}
return $return;
}
function __get($key)
{
return isset($this->_session[$key]) ? $this->_session[$key] : false;
}
public function __set($key,$val)
{
$this->_session[$key] = $val;
}
}
?>Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[help] Detect session on URL
By jomasaco in forum Web Development AreaReplies: 4Last Post: 28th Apr 2011, 05:20 PM -
China Web hijacking shows Net at risk
By Benign in forum News & Current EventsReplies: 4Last Post: 18th Nov 2010, 06:32 AM -
[PHP] Session's secure
By Nedim! in forum Web Development AreaReplies: 2Last Post: 12th Oct 2010, 05:43 PM -
stop image hijacking (anti-hotlinking) Lighttpd
By jessepure in forum Server ManagementReplies: 4Last Post: 16th Jan 2010, 12:19 PM -
Webcam session with To0 :P
By CyberJ37 in forum General DiscussionReplies: 40Last Post: 22nd Dec 2009, 09:20 AM
themaRegister - register to forums...
Version 3.56 released. Open older version (or...