Forum Moderators: coopster

Message Too Old, No Replies

Session Variable not accessible from one page to another page

Session variables not accessible with yahoo web hosting

         

little dinosaur

5:35 pm on May 15, 2009 (gmt 0)

10+ Year Member



straight to the business.....

have index page login stuff

$action = $HTTP_POST_VARS['action'];
if ( $action == 'login')
{
$usernm = $HTTP_POST_VARS['txtUsername'];
$userpwd = $HTTP_POST_VARS['txtPwd'];

if ($usernm and $userpwd)
{
$res = VerifyLogin($usernm,$userpwd);
if($res == 1)
{
//session_write_close();

// i get session variables till here
header("Location: http://www.example.com/myadmin/home.php");
exit;
}

}

}

but when i go to home page i am not able to get session variables on home page....the page is again redirecting to login page due to this...

i have tried every thing

session_write_close();
ob_start();
session_start();

code where i create sessions
TOP_LOGIN.PHP
======
ob_start();
session_start();
if ( $HTTP_GET_VARS['LOGOUT'] == 1)
{
$_SESSION["USERNAME1"] = "";
$_SESSION["USERID1"] = "";
$res = CheckError('logsuccess');

}
======

i have hosting on yahoo PHP Version 4.3.11

========================
My session variables are
=========================
session
Session Support enabled
Registered save handlers files user

DirectiveLocal ValueMaster Value
session.auto_startOffOff
session.bug_compat_42OnOn
session.bug_compat_warnOnOn
session.cache_expire180180
session.cache_limiternocachenocache
session.cookie_domainno valueno value
session.cookie_lifetime00
session.cookie_path//
session.cookie_secureOffOff
session.entropy_fileno valueno value
session.entropy_length00
session.gc_divisor100100
session.gc_maxlifetime14401440
session.gc_probability11
session.namePHPSESSIDPHPSESSID
session.referer_checkno valueno value
session.save_handlerfilesfiles
session.save_path/tmp/tmp
session.serialize_handlerphpphp
session.use_cookiesOnOn
session.use_only_cookiesOffOff
session.use_trans_sidOffOff

==============

i m stuck up please tell me from which step i can solve it ...

Thanks,

Little Dinosaur

[edited by: dreamcatcher at 5:52 am (utc) on May 16, 2009]
[edit reason] use example.com. Thanks. [/edit]

abidshahzad4u

1:41 pm on May 16, 2009 (gmt 0)

10+ Year Member



I think this will be better to use session_start() as first line of your web page like
<?php
session_start();
/*
your code
*/
?>