Session not working

Achintya,

From when you are getting the error ?

As u seems to be using php for web developing not less that 2 year. So you must have done some thing before too.

Hence I want to know what changes you have done with the settings of your webserver or php ini file or anything related before starting this project or with this project.

As we can see you have changed the local and master values of save session path.

So let us know the details, if any available.

Besides thinking of what changed between working <-> not working,
Did setting use_trans_id to 1 (true) and restarting the server make any difference?

Try running this file and post back what you get

<?php
$f_module_name = session_module_name();
$i_auto_start = ini_get('session.auto_start');
$i_use_cookies = ini_get('session.use_cookies');
$i_use_only_cookies = ini_get('session.use_only_cookies');
$i_cookie_path = ini_get('session.cookie_path');
$f_cookie_params = session_get_cookie_params();
$i_referer_check = ini_get('session.referer_check');
$i_save_handler = ini_get('session.save_handler');
$i_save_path = ini_get('session.save_path');
$f_save_path = session_save_path();
$i_use_trans_id = ini_get('session.use_trans_id');
echo '<pre>';
echo 'f_module_name: ';
var_dump($f_module_name);
echo 'i_auto_start: ';
var_dump($i_auto_start);
echo 'i_use_cookies: ';
var_dump($i_use_cookies);
echo 'i_use_only_cookies: ';
var_dump($i_use_only_cookies);
echo 'i_cookie_path: ';
var_dump($i_cookie_path);
echo 'f_cookie_params: ';
var_dump($f_cookie_params);
echo 'i_referer_check: ';
var_dump($i_referer_check);
echo 'i_save_handler: ';
var_dump($i_save_handler);
echo 'i_save_path: ';
var_dump($i_save_path);
echo 'f_save_path: ';
var_dump($f_save_path);
echo 'i_use_trans_id: ';
var_dump($i_use_trans_id);
echo '</pre>';
?>

hum, are you sure it’s not a rights protection problem ?

have you try this issue : http://bytes.com/topic/iis/answers/712282-session-not-working-iis

Thanks for your reply LrtL… But my problem is not in Windows as my testing server and production server…both are linux.

This is what I get:

f_module_name: string(5) “files”
i_auto_start: string(1) “0”
i_use_cookies: string(1) “1”
i_use_only_cookies: string(1) “0”
i_cookie_path: string(1) “/”
f_cookie_params: array(5) {
[“lifetime”]=>
int(0)
[“path”]=>
string(1) “/”
[“domain”]=>
string(0) “”
[“secure”]=>
bool(false)
[“httponly”]=>
bool(false)
}
i_referer_check: string(0) “”
i_save_handler: string(5) “files”
i_save_path: string(46) “/var/www/vhosts/payrolltrack.com/httpdocs/tmp/”
f_save_path: string(46) “/var/www/vhosts/payrolltrack.com/httpdocs/tmp/”
i_use_trans_id: string(0) “”

The only thing I can see that looks suspicious is the

“/var/www/vhosts/payrolltrack.com/httpdocs/tmp/”

Is that an actual physical (not virtual) path?

Even if it is, it might be too “deep”.

Try making a tmp directory under var and changing it to that.

And if that doesn’t work, please try the

use_trans_id 1

Yes that is an actual physical path…Ok let me try what you said…

Anyone has any other idea? Thanks.

try to use on the first line:

ini_set(“url_rewriter.tags”,“”);

When you created a shallower temp folder what did you use for the path?
When you tried use_trans_id 1 - restart server - did you see anything in the browser address bar?

Thanks guys…Please explain it once more…

When you created a shallower temp folder what did you use for the path?

In other words, instead of

/var/www/vhosts/mydomain.com/httpdocs/tmp/

or

/var/lib/php/session

if you created a folder (with adequate permissions) at

/var/tmp

and changed your settings to point to that (without the trailing slash).

I don’t have permission other than ftp for creating a folder…So I have created this

/var/www/vhosts/mydomain.com/httpdocs/tmp/

Anyone in sitepoint.com, what can be done here? Thanks.