Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 3 of 3

This is a discussion on Session registered Vars and URL forwarding? in the Shared & Semi-Dedicated forum
I am registering variables to use in a session. On one page I have to use a header forward (header ("location: http://www.blahhblahh.com/blah.php") to send it ...

  1. #1
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225

    Session registered Vars and URL forwarding?

    I am registering variables to use in a session.
    On one page I have to use a header forward (header ("location: http://www.blahhblahh.com/blah.php") to send it to a page to display
    the variables after the page that does the forwarding does some work on it.

    My problem is
    when I forward to the other page the session variables are lost sometimes. I am assuming this is because the forwarding is like re-entering the site.
    Is there a way around this? Anyway to automatically load the next page without losing the session?
    I have tried a relative forward and this works but I read that it may not in all clients.

    Mike
    Parks Web Creation
    http://www.parkswc.com

    Professional web design and computer services at a reasonable price

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I would say you are probably losing cookie authorization somewhere...

    Without seeing the rest of your code, I would suggest dropping the 'www' out of the URL and see it that helps. The fact that eveything works with a relative forward indicates that this solution probably won't take care of your problem, but who knows?

    The problem with cookies is they authenticate to the path that you used to enter the site. For instance, I am logged into JagPC, right now, using 'jaguarpc.com', and the cookie reflects this path. If I type 'www' in front of 'jaguarpc.com' in the address bar, e.g. 'www.jaguarpc.com', then I will lose cookie auth and have to log in again under 'www.jaguarpc.com' or simply go back to 'jaguarpc.com'.

    Does this make sense?

    So, what I think is happening in your situation is a person logs in without the 'www', then gets redirected to a location WITH a 'www' hardcoded in front of it, and they are losing cookie auth.

    IMHO, if you stick to relative paths, everything should be fine, regardless of the browser client. That's what I do with all my scripts.

    This is pure conjecture on my part, but hopefully it will help you out...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,648
    I think Vin is right. By defalt Jag seems to send everthing to domain.com rather than www.domain.com. For anyone interested in Search Engine Optimaization this can have some serious results in rankings. If Vin is right I think you could do a mod rewrite in the .htaccess file to overcome this so that any request pointed to one page would redirect to another with a 301 and I think that might solve the cookie problem. I know from the stand point of a search engine domain.com and www.domain.com are treated as seperate domains. I suspect that difference would also apply to a cookie. I don't know for sure in regard to cookies but it would be worth a try.
    Last edited by Connie; 11-21-2004 at 05:39 PM.

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

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
  •