SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Safari and unset session variables

    I have a login, order, thanks page process. The user logs in, if the userid and password are valid, the user is directed to the order page where the user can submit an order. Once the order is submitted, the user is directed to the thanks page.

    Session variables are set on the login page upon successful login, and checked on the order page. If session variables are not set, the user cannot access the order page. On the thanks page, the session variables are unset.

    If the user clicks on the 'Back' button in the browser on the thanks page, the user is redirected to the login page.

    This process works as expected on IE6, Firefox 1.5.0.6 under Windows XP and Firefox under Mac 10.4.7.

    However, under Safari 2.0.4, when the user clicks the 'Back' button in the browser on the thanks page, they are returned to the order page. Somehow it seems that the unset session statement (in the thanks page) is not being run in Safari.

    I searched for an answer on the net and found someone else who experienced a similar issue, back in 2003. Never found a resolution. I searched this forum, but didn't find anything. It's possible I missed it.

    Here's the unset code:
    Code:
    session_start();
    	if (isset($_SESSION['email'])) {
    		unset($_SESSION['email']);
    	}

    Any ideas what's going on?

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sounds like safari is caching the page, so when they click back they arent actually reloading your order page, they are just viewing it from memory. this is why they are not redirected, because the memory they have of it did not send a redirect.

    i dont know why this would only happen in safari and not the other browsers though, unless safari handles caching differently than them under specific situations, which is possible.

    what http headers does your order page send? check out the live http headers extension for firefox, its very useful for viewing headers.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick response. I didn't know about live http headers extension. I'll get it installed now.

    Is there something specific I should look for in the headers?

  4. #4
    SitePoint Member
    Join Date
    Sep 2006
    Location
    Italy
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I had same issue...

    I had the same issue in oe of mine sites. I try fnd the snippet of code generated.

    Bye
    Best Pleasure Design For The Fines Adults Players Model2day.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •