<?php
	require('includes/config.php');
	session_start();	
	$dttm = strtotime(date('d-m-Y h:i:s'));
	$user = $_SESSION['userid'];
	/* updating access_token and last logged time */
	$uSql = "UPDATE users SET last_logged_on = ".$dttm." WHERE user_id = ".$user;	
	$uExe = mysqli_query( $con, $uSql );
	if( $uExe ){
		session_destroy();
		echo '<script type="text/javascript">window.location.replace("index.php");</script>';
	}
?>    