session_start() resets scroll position on refresh

Discussion in 'PHP' started by proph3t, Jun 26, 2006.

  1. #1
    For the longest time I noticed my site wouldn't "remember" the position it was scrolled to in firefox when I refreshed a page or click back/forward. Instead it would refresh at the top of the page no matter where I was previously. I finally found the cause of this, and when I remove the session_start(); from my code, it works as intended. Of course, this breaks the user login sessions and so I can't just leave session_start() out. Is there some way to fix this?
     
    proph3t, Jun 26, 2006 IP
  2. Evoleto

    Evoleto Well-Known Member

    Messages:
    253
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Interesting, I belived session_start() only effect on client side is dealing with the session cookie. I tried on my sites and looks like this assumption is correct. I belived ths scroll position is handled by the browser intependently and affected only by direct calls (like the scroll() function in JS).
     
    Evoleto, Jun 26, 2006 IP
  3. proph3t

    proph3t Guest

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I thought so too, but if I include session_start() it doesnt remember the position and if I remove it it does remember, so what else am I to conclude?
     
    proph3t, Jun 26, 2006 IP