Forum Moderators: coopster

Message Too Old, No Replies

Odd Session Problem

         

wadesmart

10:29 pm on Apr 30, 2005 (gmt 0)

10+ Year Member



04302005 1720 GMT-6

I have completed my project that I have been working on but when I went to test it (I was testing in Mozilla browser) in IE, the sessions didnt work. It only does not work in IE. In opera and mozilla things are fine but when I try to do this in IE it fails every time.

A browser is a browser so Im uncertain as to my a session wouldnt or couldnt work.

Wade

mcibor

10:31 pm on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What security level you have in IE? Maybe the session cookie isn't being set? Try the easy code first: start the session, put one var. in another file check that var.

Maybe an answer would passing the id via url?

And browser isn't just a browser. My pages look all different in various browsers. They even differ if I save them and open.

Hope you clear it out!
Michal Cibor

wadesmart

10:50 pm on May 1, 2005 (gmt 0)

10+ Year Member



05012005 1746 GMT-6

I wasnt referring to the look of pages, that is why CSS is such a hassle. I was talking about how it interprets PHP.

Now, I have tried to pass a var in a session when using IE. My version of IE is just how it was when it came with the computer. I use Mozilla from the get go. Its on med security setting.

Something else I tried was removing all the checks but that didnt work either.

This is a login page so if the user and pass match, with other criteria, a session is started. But in IE, when I check the session data, the session is started but the data isnt passed.

Its odd.

mcibor

9:02 am on May 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try showing all errors:
error_reporting(E_ALL);

See also if you can create a cookie under IE:
setcookie("test", "testing", time() + 3600);

And try passing the session id via url <a href="#?sesid=<? echo SID;?>">
and see if the session works then.

In my opinion it's the problem with cookies, however try those above. if you return any error let me know

Michal Cibor

wadesmart

12:14 pm on May 2, 2005 (gmt 0)

10+ Year Member



05022005 0712 GMT-6

I have the errors set to all but, Im not sure how to pass by url. Im looking at you code and Im not sure where to put it. When the page is submitted a script runs multiple functions checking login data and what not. If no errors are returned a session is started and a redirect occurs.

print '<meta http-equiv="refresh" content="5; url=http://localhost:8080/A_Cats_Desire/04022005/Admin/Admin_Home.php">';

Do I put the session data url as you have it in this redirect?

Wade

mcibor

8:12 pm on May 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would put it:

print '<meta http-equiv="refresh" content="5; url=http://localhost:8080/A_Cats_Desire/04022005/Admin/Admin_Home.php?SID='.SID.'">';

But then remeber to read it and put as session var. Try looking at www.php.net for more info on sessions. it's the best page I know.

Best regards
Michal Cibor

wadesmart

3:33 pm on May 3, 2005 (gmt 0)

10+ Year Member



05032005 1032 GMT-6

Ok. I did the $_GET thing and this is what it posted:

Notice: Undefined index: authorize in C:\WebDev\Work Directory\A_Cats_Desire\04022005\Admin\Admin_Home.php on line 7

Notice: Undefined index: login in C:\WebDev\Work Directory\A_Cats_Desire\04022005\Admin\Admin_Home.php on line 8

PHPSESSID=e92a9dc433e65d0108771d70e50f61af

So, the session id was passed via the url and I can get it fine. But the two values I created on the first page, $_SESSION['authorize'] & $_SESSION['login'] cant get accessed.

What does this mean?

Wade

wadesmart

3:37 pm on May 3, 2005 (gmt 0)

10+ Year Member



05032005 1036 GMT-6

Ok. I just posted about the SessionID. I changed something on my page and then relogged in again, the SessionID is not being read the second time. I see in the URL where it says?SID= but now nothing is after it.

Wade

Stormfx

6:10 pm on May 3, 2005 (gmt 0)

10+ Year Member



Like mcibor said, it sounds to me like IE is not accepting the cookies. You have to remember that the actual sessions are handled by the server. Browsers have nothing to do with session variables with the exception of cookies. When PHP creates the session, it by default attempts to set a session cookie. If IE isn't allowing the session cookie to be set, then PHP has no idea of what session the browser wants because there's no cookie. Make sure you've set IE to accept cookies. Either that, or make sure that your SID always gets passed via URL. If you have any links or forms that point back to that same page, make sure to append the SID there, as well.

wadesmart

8:02 pm on May 3, 2005 (gmt 0)

10+ Year Member



I have set IE to accept cookies and everything else. I have it set at the lowest possible setting and still IE wont see the session data.

But the thing is, Mozilla and Opera are both fine. And oddly, I have been testing with IE for a while. Im just unsure was to what has happened.