Re: sessions causing refreshing not to work [message #178323 is a reply to message #178316] |
Mon, 04 June 2012 05:56 |
Arno Welzel
Messages: 317 Registered: October 2011
Karma:
|
Senior Member |
|
|
Peter H. Coffin, 03.06.2012 05:57:
> 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.
Don't do this.
1) It won't change anything. The session itself will remain the same -
therefore it makes no sense to transmit the ID via the URL.
2) Adding session IDs to forms may destroy validity of the documents
(also see
< http://www.mtdev.com/2002/06/why-you-should-disable-phps-session-use_trans_ sid>).
--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
|
|
|