Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: sessions causing refreshing not to work Date: Mon, 04 Jun 2012 07:59:37 +0200 Organization: A noiseless patient Spider Lines: 30 Message-ID: <4FCC4EC9.4050503@arnowelzel.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="tpi80xibcZOft+rICHc6oA"; logging-data="10716"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19v1PPf2RBmX6OR/PENFUu8IvzYKfAc1cQ=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: Cancel-Lock: sha1:2XbbVDtEqWy8STPl3pb6fXUrqC4= Xref: csiph.com comp.lang.php:6245 Michael Joel, 03.06.2012 05:17: > 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. Well - thats what sessions are made for - manage a state for a *client*, not a single *window* or tab. > How would I go about fixing this so a page doesn't lose it's var data on > refresh? Think about your concept. Either you use a state within the session or you use the URL (or URL parameters) to determine, what to display. But the session will always be the same, even if the user opens multiple windows/tabs within the same browser. -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de