I'm working on a revamping of my TableEdit extension, and I'm stuck on a weird problem with $_SESSION and Firefox (mac). It looks like the session superglobal isn't being updated properly...using print_r to examine $_SERVER shows the right values at the end of one the script, but it's as if it's not really being saved to the session, and older information is being used when the next pageload happens. ... but the code works in Safari. The problem is reproducible on a two different computers - my server and my laptop (both macs).
I'm stuck... any suggestions on what I should be looking at? I had sessions working with Firefox in other code and don't know what I'm doing differently... and I really don't understand why this should be browser dependent.
MW 1.12 php 5.24 and 5.25 ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
If the code works in other browsers, it may be a bug in firefox.
I suggest you read through relevant information on http://developer.mozilla.org/ to find out specific information for Firefox. On May 21, 2008, at 9:12 PM, Jim Hu wrote:
I'm working on a revamping of my TableEdit extension, and I'm stuck on a weird problem with $_SESSION and Firefox (mac). It looks like the session superglobal isn't being updated properly...using print_r to examine $_SERVER shows the right values at the end of one the script, but it's as if it's not really being saved to the session, and older information is being used when the next pageload happens. ... but the code works in Safari. The problem is reproducible on a two different computers - my server and my laptop (both macs).
I'm stuck... any suggestions on what I should be looking at? I had sessions working with Firefox in other code and don't know what I'm doing differently... and I really don't understand why this should be browser dependent.
MW 1.12 php 5.24 and 5.25 ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Darren VanBuren onekopaka@gmail.com ---------------------------------------------- Administrator of Onekopakaspace
On May 21, 2008, at 11:31 PM, Darren VanBuren wrote:
If the code works in other browsers, it may be a bug in firefox.
True, but that's not much help for my users. I need a workaround!
I suggest you read through relevant information on http://developer.mozilla.org/ to find out specific information for Firefox.
I looked a bit at the bugzilla for mozilla and found what looks like a related problem.
https://bugzilla.mozilla.org/show_bug.cgi?id=426180
I don't completely understand the discussion - it sounds like there's an issue with FF losing the session id... but I don't think that completely makes sense.
JH
On May 21, 2008, at 9:12 PM, Jim Hu wrote:
I'm working on a revamping of my TableEdit extension, and I'm stuck on a weird problem with $_SESSION and Firefox (mac). It looks like the session superglobal isn't being updated properly...using print_r to examine $_SERVER shows the right values at the end of one the script, but it's as if it's not really being saved to the session, and older information is being used when the next pageload happens. ... but the code works in Safari. The problem is reproducible on a two different computers - my server and my laptop (both macs).
I'm stuck... any suggestions on what I should be looking at? I had sessions working with Firefox in other code and don't know what I'm doing differently... and I really don't understand why this should be browser dependent.
MW 1.12 php 5.24 and 5.25 ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Darren VanBuren onekopaka@gmail.com
Administrator of Onekopakaspace
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Not solved, but here's some more information. In my function execute(), I added:
$output .= $_SESSION['TableEditTesting']; $_SESSION['TableEditTesting'] .= "testing\n";
In Safari clicking an action button -> testing In Firefox(Mac) clicking an action button -> testing testing
Weird. I'm not sure that this actually explains the problem.
JH
On May 21, 2008, at 11:12 PM, Jim Hu wrote:
I'm working on a revamping of my TableEdit extension, and I'm stuck on a weird problem with $_SESSION and Firefox (mac). It looks like the session superglobal isn't being updated properly...using print_r to examine $_SERVER shows the right values at the end of one the script, but it's as if it's not really being saved to the session, and older information is being used when the next pageload happens. ... but the code works in Safari. The problem is reproducible on a two different computers - my server and my laptop (both macs).
I'm stuck... any suggestions on what I should be looking at? I had sessions working with Firefox in other code and don't know what I'm doing differently... and I really don't understand why this should be browser dependent.
MW 1.12 php 5.24 and 5.25 ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
It gets weirder ...
Today, Firefox doesn't set the SESSION at all - instead of testing testing, I get nothing. I wonder if it depends on where I'm connecting from: home = cable modem & wifi, work = direct.
JH On May 23, 2008, at 10:13 AM, Jim Hu wrote:
Not solved, but here's some more information. In my function execute(), I added:
$output .= $_SESSION['TableEditTesting']; $_SESSION['TableEditTesting'] .= "testing\n";
In Safari clicking an action button -> testing In Firefox(Mac) clicking an action button -> testing testing
Weird. I'm not sure that this actually explains the problem.
JH
On May 21, 2008, at 11:12 PM, Jim Hu wrote:
I'm working on a revamping of my TableEdit extension, and I'm stuck on a weird problem with $_SESSION and Firefox (mac). It looks like the session superglobal isn't being updated properly...using print_r to examine $_SERVER shows the right values at the end of one the script, but it's as if it's not really being saved to the session, and older information is being used when the next pageload happens. ... but the code works in Safari. The problem is reproducible on a two different computers - my server and my laptop (both macs).
I'm stuck... any suggestions on what I should be looking at? I had sessions working with Firefox in other code and don't know what I'm doing differently... and I really don't understand why this should be browser dependent.
MW 1.12 php 5.24 and 5.25 ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
I'm not sure if anyone is following my replies to self, but just in case...
I have a workaround, but I don't understand it.
There were multiple problems. First, I had to call wfSetupSession if the session wasn't already established. That makes sense to me. I think that accounts for the situation where the session variable wasn't there at all.
Second, the part that doesn't make sense to me: In Firefox, the session would get written on the first load, but then it wouldn't get updated. To update the session variable, I have to reload the page, via a url that has a session variable in it. I'm doing this via a line that reloads the page once.
$ff = trim($wgRequest->getText('ff')); #echo "ff:$ff"; if($this->act['view'] == '' && $ff == '') header("Location:".$this-
url."&ff=loaded&view=".$_SESSION['TableEditView']);
$this->url = $wgServer.$wgScriptPath."/index.php? title=Special:TableEdit&pagename=$this->page_name&id=".$this-
box_req['box_id']."&page=".$this->box_req['page_uid'];
$_SESSION['TableEditView'] is a session global that I set at the end of the execute method in my special page. What is very, very weird to me is that 1) There has to be a session variable in the URL 2) It can't just be $_SESSION['foo'] 3) This doesn't work if I put the same session variable in the input hidden via POST
I don't like this solution, but it works, at least as far as I've tested it. I'd be happier if I understood why it works.
Wrt the original problem ... why only in Firefox?
During my exploring the problem, I found various things that are could be related, including:
http://www.php.net/manual/en/function.session-cache-limiter.php
"In private mode, the Expire header sent to the client may cause confusion for some browsers, including Mozilla. You can avoid this problem by using private_no_expire mode. The expire header is never sent to the client in this mode."
But changing this in GlobalFunctions doesn't fix the problem.
JH
On May 24, 2008, at 4:26 PM, Jim Hu wrote:
It gets weirder ...
Today, Firefox doesn't set the SESSION at all - instead of testing testing, I get nothing. I wonder if it depends on where I'm connecting from: home = cable modem & wifi, work = direct.
JH On May 23, 2008, at 10:13 AM, Jim Hu wrote:
Not solved, but here's some more information. In my function execute(), I added:
$output .= $_SESSION['TableEditTesting']; $_SESSION['TableEditTesting'] .= "testing\n";
In Safari clicking an action button -> testing In Firefox(Mac) clicking an action button -> testing testing
Weird. I'm not sure that this actually explains the problem.
JH
On May 21, 2008, at 11:12 PM, Jim Hu wrote:
I'm working on a revamping of my TableEdit extension, and I'm stuck on a weird problem with $_SESSION and Firefox (mac). It looks like the session superglobal isn't being updated properly...using print_r to examine $_SERVER shows the right values at the end of one the script, but it's as if it's not really being saved to the session, and older information is being used when the next pageload happens. ... but the code works in Safari. The problem is reproducible on a two different computers - my server and my laptop (both macs).
I'm stuck... any suggestions on what I should be looking at? I had sessions working with Firefox in other code and don't know what I'm doing differently... and I really don't understand why this should be browser dependent.
MW 1.12 php 5.24 and 5.25 ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
mediawiki-l@lists.wikimedia.org