User getting redirect to login page

hi all

i have a form page which is accessible only after the user gets logs in.

when a user logs in then a session repair_access is set to true


$_SESSION['REPAIR_ACCESS'] = true;

after loggin the user enter information in the form, when he click submit button the

information is getting stored in database correctly but he is redirected to index.php which is login page.

this is my config file


$conn3=mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db('repair_data', $conn3);
session_start();

this code is on top of my form


<?php require_once("config.php");
if(!isset($_SESSION['REPAIR_ACCESS']))
	header("Location:index.php");
$msg="";
?>

session.gc_maxlifetime value is already 1440.

this is only happening online. everything is fine on localhost.

vineet

hi

i m having two separate restricted access folders based on separate login forms and sessions.

i m using same technique for both folder files. everything works fine for first folder but having trouble with second folder files.

i have a form page in second folder which is accessible only after the user gets logs in.

when a user logs in second folder then a session repair_access is set to true for second folder.


$_SESSION['REPAIR_ACCESS'] = true;

after loggin the user enter information in the form, when he click submit button the information is getting stored in database correctly but he is redirected to index.php which is login page.

i m not able understand that if the user reaches the form page that means the SESSION has been set to true but then why is he redirected back to loginpage when he clicks submit button.

this is my config file for second folder


$conn3=mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db('repair_data', $conn3);
session_start();

this code is on top of my form in second folder


<?php require_once("config.php");
if(!isset($_SESSION['REPAIR_ACCESS']))
	header("Location:index.php");
$msg="";
?>

Are the sessions conflicting with anything ?

vineet

and the problem or question was…???