Session lost problem....Its urgent please help me

hello everyone…i need your help

i face session lost problem so many times and every times i just find out other logic to implement the code in different ways. but i don’t get a perfect solution.Please help me to resolve this…why it was happened…
i searched google for it…this is the common problem but i dont get any proper solution…

recently i write a code to fetch tweets from twitter…but when returning back from .i lost my session value…

supp this is my page page.php
when user click on button…i just check the form submitted like this
$_SESSION[‘id’]=$id; //supp $id=10
header("Location:tweet.php ");
i already included session_start() at the top of every page.

in tweet.php i just generate a token and send user to twitter for authorization.

in tweet.php i checked session started
i check it with
in this page i used session like this
header(“Location:$url”) //$url will be authoritarian url generated by twitter oauth…

after returning from twitter some times session variable are not lost.but sometimes i lost my session.this really irritates me…if logic is wrong then every time session destroyed…

i check my php.ini file configuration…

session_save.path=/tmp; //by default

register global are off…

any help is appreciated…
below is my code

this is my code look like

this is my first page when user request for twitter// sucess.php

<?php session_start();
$token=$_SESSION['logintoken']; //login token contain email of the user 
$sql=mysql_query("SELECT id from f_login where email='$token'");

$sql1=mysql_query("SELECT * from f_general where gid='$id10'"); //to get name    
while($row = mysql_fetch_array($sql1))


<form method="post" action="<?php echo $PHP_SELF; ?>" name="add">
<input type="submit" id="Mybutton" style="background-color:#E2E1E0; " value="Add Application" name="submit" onmouseover="fun();" onmouseout="fun1();"/> 

//-----------------------------this is my page after redirect

<?php session_start();


//creating a object and define consumer key and consumer token
$twitteroauth=new TwitterOAuth($consumer_key,$consumer_secret);
$request_token = $twitteroauth->getRequestToken('');
// Saving them into the session
//now we are calling the url and send above data in it
// Let's generate the URL and redirect
$url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
$query=mysql_query("select * from f_twitter where loginiduser='$registered'");
{//first time when user does not have any record in database
$query=mysql_query("insert into f_twitter(token,token_secret,url,loginiduser)values('$token','$token1','$url','$registered')");
header('Location: '. $url);
{//if record exist then update the staus in database
$query=mysql_query("update f_twitter set token='$token',token_secret='$token1',url='$url' where loginiduser='$registered'");
// It's a bad idea to kill the script, but we've got to know when there's an error.
die('Something wrong happened.');


//this is my page after returning from twitter

<?php session_start();

$sqlquery1=mysql_query("select token,token_secret,url from f_twitter where loginiduser='$idloginuser'");
if(!empty($_GET['oauth_verifier']) && !empty($token) && !empty($token_secret))
$newobject=new TwitterOAuth($consumer_key,$consumer_secret,$token,$token_secret);
$_SESSION['access_token'] = $tokencall;
$user_info = $newobject->get("account/verify_credentials"); //you get userid 
if(isset($user_info->error)) //if generate error send to authorise url of twitter

$query12=mysql_query("select * from users where oauth_provider = 'twitter' AND oauth_uid = ". $user_info->id);
$query = mysql_query("INSERT INTO users (oauth_provider, oauth_uid, username, oauth_token, oauth_secret,loginid,oauth_verifier) VALUES ('twitter', {$user_info->id}, '{$user_info->screen_name}', '$token', '$token_secret','$idloginuser','$verifier')");
$query1 = mysql_query("SELECT * FROM users WHERE id = " . mysql_insert_id());
$result = mysql_fetch_array($query1);
// Update the tokens
$query = mysql_query("UPDATE users SET oauth_token = '$token', oauth_secret = '$token_secret', oauth_verifier='$verifier' WHERE oauth_provider = 'twitter' AND oauth_uid = {$user_info->id}");
$_SESSION['username'] =$result['username'];
$_SESSION['oauth_uid'] = $result['oauth_uid'];
$_SESSION['oauth_provider'] =$result['oauth_provider'];
$_SESSION['oauth_token1'] =$result['oauth_token'];
$_SESSION['oauth_secret'] =$result['oauth_secret'];
$home_timeline = $newobject->get(''); 
$newobject->post('statuses/update', array('status' => $texttopost));
$_SESSION['sucess']="Your tweet has been posted successfully";
$_SESSION['failure']="There is some problem occur when connecting to twitter.Please try again";
}elseif(!$texttopost && $_SESSION['oauth_token1'] && $_SESSION['oauth_secret'])
}//end of else--------------------------------------------

}    //end of if    



I already check my php.ini this session.gc_maxlifetime is set to 1440
and i am not leaving the site for long time.

the main problem is that i loose session only for one time.when first time i try to
authenticate user through twitter…next time i didn’t face this problem.i get this problem in all browser…not every time
this is my session setting in php.ini file

Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary wddx

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0 PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0