PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I will be using session variables to control who and how long users are logged in.
The problem is the script below works fine in FF, but not in IE.
In IE, as soon as you login the welcome page is displayed, but as soon as you continue to another page, it returns back to the login page and there is no session_id!!!
Is there something wrong with IE or is it a setting i need to change?
The only thing that seems a bit off is the use of $_GET['page'] when you are using $_POST['username'] earlier in the page. Plus you are checking only checking on $_Session['uid'] and never check for $_Session['username'];
If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where the PHP directive register_globals is disabled.
register_globals: important note: Since PHP 4.2.0, the default value for the PHP directive register_globals is off. The PHP community encourages all to not rely on this directive but instead use other means, such as the superglobals.
Caution
This registers a global variable. If you want to register a session variable from within a function, you need to make sure to make it global using the global keyword or the $GLOBALS[] array, or use the special session arrays as noted below.
Caution
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister().
where in the directory structure is the session cookie getting set? what is your ini settings for the session bits? Do you change protocols, subdomains, or directories after the session is set? .. Where do you change to and from what?
feyd wrote:where in the directory structure is the session cookie getting set? what is your ini settings for the session bits? Do you change protocols, subdomains, or directories after the session is set? .. Where do you change to and from what?
Session is set in base directory ./admin.php
Session settings are default as per install of PHP 4.3.10
Session Support enabled
Registered save handlers files user
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
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_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.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path C:\PHP\sessiondata C:\PHP\sessiondata
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off
I do not change protocol, directory or subdomain.
The base directory loads the file admin.php with an include for each module, as shown in the admin.php file in my first post.
Do you have a live version of the problematic code so that I can see if I can replicate the error? I find it strange that PHP (which is completely server based) is causing incompatibilities between FireFox and Internet Explorer: it's probably something about headers or something.