Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 6 of 6
  1. #1
    Gold Lifetime Member

    Join Date
    Feb 2006
    Posts
    42
    DNF$
    89
    Bank
    0
    Total DNF$
    89
    Donate  

    keeping session variables across subdomains

    I need to keep one variable when users traverse from one subdomain to the other.

    I have tried rewriting part of the htaccess file to:
    php_value session.cookie_domain .hostname.com

    this will not work, the session variable does not pass at all.

    any suggestions or other tricks that may work for this?

  2. #2
    Platinum Lifetime Member
    goodyork's Avatar
    Join Date
    Jan 2005
    Location
    Beijing
    Posts
    794
    DNF$
    785
    Bank
    0
    Total DNF$
    785
    Donate  

    Re: keeping session variables across subdomains

    session.cookie_domain always work good at my server
    (for session shareing across subdomain)

    Are you sure your setting correctly?

  3. #3
    Platinum Lifetime Member
    movil's Avatar
    Join Date
    Aug 2005
    Location
    Spain
    Posts
    70
    DNF$
    440
    Bank
    0
    Total DNF$
    440
    Donate  

    Re: keeping session variables across subdomains

    Maybe if you provide more information about how your doing this ?

    One easy thing you can do if session won\'t work is passing the PHPSESSID string by GET to the subdomain, then you will not loose the session.

  4. #4
    Gold Lifetime Member

    Join Date
    Feb 2006
    Posts
    42
    DNF$
    89
    Bank
    0
    Total DNF$
    89
    Donate  

    Re: keeping session variables across subdomains

    i have two subdomains. One gets a post variable from outside the site (ads), when a user comes to my page, and enters in any information the variable is stored in the DB with the information they enter. Problem is that this variable is lost when they go to the other subdomain., because they are technically different servers.

    I was hoping to see if there was a way to do transfer this variable across.
    GET variables are not an option, because I do not want my users to know that we are tracking this information.

  5. #5
    Platinum Lifetime Member
    movil's Avatar
    Join Date
    Aug 2005
    Location
    Spain
    Posts
    70
    DNF$
    440
    Bank
    0
    Total DNF$
    440
    Donate  

    Re: keeping session variables across subdomains

    I didn\'t know you were storing sessions between different servers. In php sessions are stored on static files, there is no chance the other server will read this, unless it has access to the same session storage.
    Basically I would recommend to send this encrypted, and decrypt in the other server.

    Otherwise you need to store sessions in mysql:
    http://shiflett.org/articles/guru-speak-jan2005
    While the default session storage mechanism is adequate for many PHP developers, you might find yourself wanting to modify its behavior from time to time. One of the most common reasons for wanting to change the default behavior is to store sessions in a database rather than the filesystem. The top reasons for this desire are:

    1. The application needs to be able to run on multiple servers without server affininty (methods that direct requests from the same client to the same server). An easy way to make sure that sessions continue to work properly is to store sessions in a central database that is common to all servers.

  6. #6
    Gold Lifetime Member

    Join Date
    Feb 2006
    Posts
    42
    DNF$
    89
    Bank
    0
    Total DNF$
    89
    Donate  

    Re: keeping session variables across subdomains

    well, they are not different servers. The browser and the server treat them that way because they are apache virtual servers.

    I am sorry to cause so much confusion.

    I just need to pass these variables between the two subdomains..i.e.
    sub1.mysite.com
    sub2.mysite.com

Similar Threads

  1. subdomains for tog.com, what should i choose?
    By oberheimer in forum Website Development and Design Discussion
    Replies: 0
    Last Post: 03-05-2006, 10:30 PM
  2. AreFun.com Network - (25+ subdomains developed)
    By scottatmu in forum Developed Websites for Sale
    Replies: 0
    Last Post: 03-07-2004, 05:42 PM
  3. is anyone else selling subdomains off??
    By unclewilco in forum General Domain Name Discussion
    Replies: 6
    Last Post: 06-07-2003, 10:26 AM
  4. Can subdomains be used with country code domains?
    By ObtainADomain in forum Gold Cafe
    Replies: 15
    Last Post: 01-30-2003, 04:28 PM

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
  •  

Domain name forum recommended by Domaining.com