Link to home
Start Free TrialLog in
Avatar of Randy Johnson
Randy JohnsonFlag for United States of America

asked on

**URGENT** PHP cookies firefox/netscape vs IE

ok here is what some background


Site is PHP 4.x.x
Apache server
Sessions are stored in the database


When using any browser but IE you can login to the site just fine.

when I look into the sessions table it creates 1 row for the user logging in


When a user goes to the login page with IE

it creates a session when hitting the login page, but when you tap login and the script goes back to the login page because of some unknown reason.  Now you look into the sessions tables there is about 5 session rows

nobody else but me is hitting the script.   I also delete the session table data before each try so I can see what is new

It is not my code I just need to fix it.  

I have no idea why it works in firefox/mozilla/netscape and not in IE.

Thanks!

Randy
Avatar of aksteve
aksteve

Sounds like you have a loop..
Something like:
if(!$_SESSION){ header("Location: index.php"); }

Cant really help ya without a block of code though..

I would look near where the page is reloading itself (include), calling a header("Location:"), or where your session function is being called from..
Avatar of Randy Johnson

ASKER

Just to elaborate,  this app uses database sessions with cookies on the client

the cookie is not getting set propertly on IE but it is for Netscape/Firefox

I did a print of out session variables in IE and nothing shows, I did it in netscape/firefox and it shows the data just fine.

hmm.....
Does this look right to you?

setcookie( "sess_key",$key,0,"/","." . str_replace( "www","",$_SERVER["SERVER_NAME"] ),0 );
I figured it out the above line should be setcookie( "sess_key",$key,0,"/", str_replace( "www","",$_SERVER["SERVER_NAME"] ),0 );

I am not sure why the previous client had the extra period in there.


Randy
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial