SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm working on a site that includes general information, shopping and a message board. I figure to keep things simple I would set up, for example, www.mydomain.com on the main site, shop.mydomain.com and forums.mydomain.com. The latter two would be two sub directories.

    I plan on using sessions to track the user when they log into the message forums and also use sessions to track the shopping cart contents on the other site. My question is that if they go add things to their shopping cart session on one site, jump over to the message forums site, then go back to the shopping cart site -- will the session still be there? Or rather, do sessions expire only when the browser closes or when a visitor jumps to another site?

    I thought about sticking evertyhing under one domain, but I'll probably be using vboard for my message board and it uses its own sessions.

    Oh, I'll throw this into the mix even though it belongs in the Php/Mysql forum, can these three domains (above) share a mysql database. Has someone done this?

    Thanks!

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I believe sessions generally end when someone closes the browser. Remember, the session identifier is a cookie on the client side. However, sessions can "expire" while the client's browser is still open. Here is a link that discusses some of these issues with sessions:

    http://forums.devshed.com/showthread...light=sessions
    Last edited by 7stud; Apr 14, 2001 at 12:06.

  3. #3
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmm this is a good question. When a host sets a session cookie, the info in that cookie is only viewable by the same host.

    Even though your subdomains will be on the same host, physically, I think your browser would treat them as different hosts.

    You'd have to put the session id onto the query string for each link that goes across to a different subdomain.

    If you don't rely on cookies and you always use the query string then I don't think you'd need to worry.

    My advice though is: try it and see what happens.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    holmescreek's question was this:
    My question is that if they go add things to their shopping cart session on one site, jump over to the message forums site, then go back to the shopping cart site -- will the session still be there?
    not whether one of the other hosts would be able to read the session id, so he should be able to read the session id without passing it as part of the url, but your suggestion to pass the session id as part of url would solve any of those problems.


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
  •