470,849 Members | 1,069 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Sessions

HI,

I want to store some data in Sessions, but i have this error

Warning: Unknown(): Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session extension
does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively. in Unknown on line 0

Warning: Unknown(): open(/tmp\sess_622d49ff6fbad164ba2ad7cd05fdd544, O_RDWR)
failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that
the current setting of session.save_path is correct (/tmp) in Unknown on
line 0

My version of php is version 4.3.4

Is there something that I have to change in my php.ini file?

Thanks

Alain


Jul 17 '05 #1
1 15504
Alain Dhaene wrote:
HI,

I want to store some data in Sessions, but i have this error

Warning: Unknown(): Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session extension
does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively. in Unknown on line 0

Warning: Unknown(): open(/tmp\sess_622d49ff6fbad164ba2ad7cd05fdd544, O_RDWR)
failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that
the current setting of session.save_path is correct (/tmp) in Unknown on
line 0

My version of php is version 4.3.4

Is there something that I have to change in my php.ini file?

Thanks

Alain

My guess would be that register_globals is set to "Off" in you php.ini
file. This is, however, not a bad thing (see link below). There are
two ways to "fix" this problem you're having:

1) Declare your variables. I use something like this:

* For input from a form:

if(!ISSET($_REQUEST["var"])){
$var = 0;
} else {
$var = $_REQUEST["var"];
}

Perhaps an even better way to do it would be to use:
If the form that's sending input to your script uses GET:
$_GET["var"]
If the form that's sending input to your script uses POST:
$_POST["var"]

2) Set "register_globals = On" in your php.ini file.
While this would be a faster fix, it's not the best choice.

By default, newer versions of PHP have register_globals turned Off by
default, for security purposes. There's a discussion about that here:
http://us2.php.net/register_globals

Regards,

- Dan
http://www.dantripp.com/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by The Plankmeister | last post: by
13 posts views Thread by jing_li | last post: by
3 posts views Thread by Maxime Ducharme | last post: by
3 posts views Thread by Will Woodhull | last post: by
12 posts views Thread by D. Shane Fowlkes | last post: by
6 posts views Thread by Daniel Walzenbach | last post: by
22 posts views Thread by magic_hat60622 | last post: by
Atli
2 posts views Thread by Atli | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.