Jump to content

cookies dont expire.


xyn

Recommended Posts

This isnt really a big issue but,

i have a desktop application using flex,

which submits login data to the server, if correct sets a cookie

for 60 seconds, and returns the var to flex.

 

but after 60 seconds the cookie isnt expired.

 

my code:

<?
session_start();
require_once("connections/db_con.sql.php");
require_once("classes/functions.inc.php");
if(!$_SESSION['intranet_authorised']){
$error =0;
if(!$_POST['username']) $error++;
if(!$_POST['password']) $error++;
$sql_check =mysql_query("select * from `intranet_accounts` where `account_email`='".secure($_POST['username'])."' and md5(`account_password`) ='".md5(secure($_POST['password']))."'");
if(!mysql_num_rows($sql_check)) $error++;
if($error >=1){
	print "&isValidLogin=0";
}else{
	$data =mysql_fetch_assoc($sql_check);
	setcookie("intranet_dklogon","{$data['account_id']}:".md5($data['account_password']),time()+60);
	mysql_query("update `intranet_accounts` set `data_last_login`=now() where `account_id`='{$data['account_id']}'");
	print "&isValidLogin=1";
}
}else{
print "&isValidLogin=1";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/98307-cookies-dont-expire/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.