Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "Peter H. Coffin" Newsgroups: comp.lang.php Subject: Re: sessions causing refreshing not to work Date: Sat, 2 Jun 2012 22:57:15 -0500 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="le/2G4+BNpieVhQI6uJ2Lw"; logging-data="29005"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ioeaAv+JtfaogAlEomHDR" User-Agent: slrn/0.9.9p1 (OpenBSD) Cancel-Lock: sha1:KpgZ88MW5CnbSfV7iAWi1kkGMko= Xref: csiph.com comp.lang.php:6237 On Sat, 02 Jun 2012 23:17:03 -0400, Michael Joel wrote: > I have page data being sent through a php script that uses sessions to > pass along variables. These vars are used to load data. > > If a user opens a page, everything works fine. > If they open another in a new window it works fine. > If they tab back over to the original browser window and hit refresh it > switches to the last page they opened in the other window. > > This is because sessions is keeping that last var data in memory so the > old page when refreshed reads the new var data and opens new data > instead of refreshing the old. > > How would I go about fixing this so a page doesn't lose it's var data on > refresh? Set session.use_trans_sid, unset session.use_cookie, don't forget to grab the session ID out of the $_GET array for every page load. Yes, your URLs will be ugly, and it'll be not impossible for someone to end up screwing things somehow with URL bookmarking or sharing. -- 76. If the hero runs up to my roof, I will not run up after him and struggle with him in an attempt to push him over the edge. I will also not engage him at the edge of a cliff. (In the middle of a rope-bridge over a river of lava is not even worth considering.)