Forum Moderators: coopster

Message Too Old, No Replies

Session stopped working SUDDENLYY

Stopped in IE & Opera but working in FF & Netscape

         

smagdy

6:56 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



Hello everybody!

How is that just possible? Just suddenly suddenly stopped working!

Ive a script that lose the session on redirect in IE6 & Opera but NOT in FF & NS

Instead of showing it here, i even tried this simple example that also didnt work!

This is soooo strange but surely is an IE session's BUG, but any solution?

page1.php

<?php if (isset($_GET['link'])) { session_start(); $_SESSION['myvariable'] = 'Hello World'; header('Location: ['...] . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/page2.php'); exit; }?> <a href="<?php print $_SERVER['REQUEST_URI'] . '?link=yes';?>">Click Here</a>

page2.php

<?php print 'Here is page two, and my session variable: '; session_start(); print $_SESSION['myvariable']; exit;?>

Thanks in advance

smagdy

7:00 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



I am sorry, please somebody move it to "PHP" disscussion!

also i wanted to add that i tried everything like clearing cache cookies and deleting Opera and restarting computer back again...

Thanks

smagdy

9:01 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



This is how i let it work in IE6...

I open Netscape 8.1 and i open the same page that has the sessions and once its excuted .. it then work in IE6 then it stop working again after sometime 1 hour or something.....

Any clues?

Thanks in advance

DrDoc

9:15 pm on Mar 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Before sending the header(), call
session_write_close()

smagdy

9:21 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



i did that too!

DrDoc

9:29 pm on Mar 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which PHP version do you have?
And, if you print $_SESSION['myvariable'] instead of the header, does it print properly?

Try to trigger page2 through a link first, and see if that makes a difference.

smagdy

9:36 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



I think now its working :)

adding:

- session_write_close();
- exit;
- Checking if there is broken image.
- adding alt to images.

Then deleting all temporary files, history and closing all browsers and restart!

I will post again if it stopped again, but till then everything is fine!

Please somebody remove the thread to PHP so it can help the rest, i clicked on Perl by fault..!

Thanks

smagdy

10:07 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



Again!

When i said it worked, it was working in both IE6 and opera, but now suddenly stopped again in both.

I opened NS 8.1 and excuted the script then now its working again in both IE6 and Opera.

What is the relation?

I think its just something with my computer or what?

smagdy

11:11 am on Mar 29, 2006 (gmt 0)

10+ Year Member



Please can somebody help?

PHP sessions are lost on redirect on IE6 and this is just on my testing computer!

and it works on IE6 when i open NS 8.1 and just go to any page that excutes session_start() on my site! then it stops again after maybe 45 min!

i tried it on IE6 and IE5.5 on different computers and it worked fine direct.

of course i cleard cache, cookies and restarted the computer!

So i dono its just something with my computer, btw i used windows cd to delete and re-install IE6.

was that enough way to remove IE6 completely and its registery and everything or what to do with this buggy thing?

Thanks in advance