SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Sep 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    http_referer or returning to previous location

    Hi, I have a myspace clone script and the author only was using sessions not cookies. This was annoying because often you would have to login again, and you wouldn't realize it sometimes until you tried to perform an action in which case after logging in you would be brought to your personal member section, which means if you want to look at that picture you have to hit back in your browser a few times to go back to where you were now that you are logged in.

    The author of the software attempted to fix this, but now if you go to the main site, it still shows you not logged in unless you try to perform an action that requires you to be logged in, like view a picture. The problem is that instead of bringing you to the login form, it brings you to the front page I believe because he has it set up to bring you to the http_referer which is his way of making you go back to where you were previously browsing.

    I know that vbulletin has it where just about no matter what you are doing, if you are prompted to login, after you login, you are taken back to the same spot or your post would be posted dispite the fact that you weren't logged in before.

    Here's my real question:
    Rather than set a variable for the $http_referer and then try to go to it after the login (which doesn't seem to work) is there a better way?

    Any suggestions appreciated!!

    Chris

  2. #2
    Non-Member
    Join Date
    Sep 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, now that I think about it, wouldn't it be much easier to check if the cookie exists upon going to index.php the first time. As I said before, if you have a cookie but no active session, you remain logged out until you perform something that finds the cookie and logs you in thus bringing you back to the index.php.

    If you originally went to index.php like normal and it found the cookie there and logged you in, then everything should be all set. Is there an even easier way?


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
  •