Skip to main content
January 8, 2009
Answered

Site sometimes supports sessions, sometimes not, depending on user

  • January 8, 2009
  • 4 replies
  • 710 views
I've got something very weird going on with sessions. A particular website supports session variables -- OR NOT -- depending on where the site is viewed from. However, a location that doesn't see sessions on this site will see sessions on other ColdFusion sites. Whether or not a particular location sees sessions does not depend on whether the computer is on a network. It does not depend on whether it's a PC or a Mac, or whether cookies are enabled. I have no idea what it does depend on.

In order to fix this, I need to tell the host tech support exactly what to do. My experience with them is that I have to support the support.

Here's the details.

Platform: ColdFusion MX on Windows.

The website does NOT support sessions if the visitor is:
1) Using a PC with Windows XP on a network with cookies enabled (me, and probably low-level host tech support)
2) Using a Mac that is not networked (my client at home)

The website DOES support sessions if the visitor is:
1) Using a PC with Windows, possibly networked (my client at work, and probably high-level host tech support)).

Note: My client doesn't know whether his computer at work is networked. I didn't ask the host tech support whether they were networked, but I assume they are. Each time I've talked with low-level tech support people, they see that sessions are not working. But then they pass the ticket up to high-level techs (that I can't talk to) who say sessions are working fine.

At any rate, there's enough information here to eliminate networks, cookies and PCs vs. Macs as the determining factor here.

I made a test system, and put it on two sites: my client's site on CF MX (where sessions sometimes don't work), and another site on CF 8 (where sessions always do work).

Site A) Here's the test on the site where sessions sometimes DON'T work.

http://birdprecision.com/z-test-sessions-1.cfm

Site B) Here's the test on the site where sessions always DO work.

http://brilliantgreenmarketing.com/z-test-sessions-1.cfm

Do you have any idea what's happening here? And what I should tell the host's tech support, to fix it?

In any case, it would help if you say what results you get for Site A, and details about your platform. If enough people did this, the answer might emerge simply from that.

As for me, I'm totally mystified. I've never seen anything like this.

Thanks!!!
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    VeryHopeful wrote:
    > Mack, I appreciate your reply, but I don't fully understand it.
    >
    > 1) On Site A, why do sessions work for some users and not others?

    You're trying to set cookies on the ".com" domain which is not allowed,
    so the cookie doesn't "stick" on the browser so a new session is created
    on the server for each request. Check if you have something like
    <cfapplication setdomaincookies="true"> or <cfcookie domain=".com"> in
    your code.

    > 2) For users that don't see sessions on Site A, why do sessions work on Site
    > B?

    Because on B you're not setting cookies on the .com domain.

    >
    > 3) What do I need to tell host for Site A to change on the server, so
    > sessions will work for everyone on Site A the way they do for Site B?

    Remove the code setting the cookie on the .com domain.

    --
    Mack

    4 replies

    January 12, 2009
    Mack,

    You were right, and your solution worked.

    Thank you so much!
    Newsgroup_UserCorrect answer
    Inspiring
    January 9, 2009
    VeryHopeful wrote:
    > Mack, I appreciate your reply, but I don't fully understand it.
    >
    > 1) On Site A, why do sessions work for some users and not others?

    You're trying to set cookies on the ".com" domain which is not allowed,
    so the cookie doesn't "stick" on the browser so a new session is created
    on the server for each request. Check if you have something like
    <cfapplication setdomaincookies="true"> or <cfcookie domain=".com"> in
    your code.

    > 2) For users that don't see sessions on Site A, why do sessions work on Site
    > B?

    Because on B you're not setting cookies on the .com domain.

    >
    > 3) What do I need to tell host for Site A to change on the server, so
    > sessions will work for everyone on Site A the way they do for Site B?

    Remove the code setting the cookie on the .com domain.

    --
    Mack
    January 9, 2009
    Mack, I appreciate your reply, but I don't fully understand it.

    1) On Site A, why do sessions work for some users and not others?

    2) For users that don't see sessions on Site A, why do sessions work on Site B?

    3) What do I need to tell host for Site A to change on the server, so sessions will work for everyone on Site A the way they do for Site B?

    Thanks!
    Inspiring
    January 8, 2009
    VeryHopeful wrote:
    > I've got something very weird going on with sessions. A particular website
    > supports session variables -- OR NOT -- depending on where the site is viewed
    > from. However, a location that doesn't see sessions on this site will see
    > sessions on other ColdFusion sites. Whether or not a particular location sees
    > sessions does not depend on whether the computer is on a network. It does not
    > depend on whether it's a PC or a Mac, or whether cookies are enabled. I have
    > no idea what it does depend on.
    >
    > In order to fix this, I need to tell the host tech support exactly what to do.
    > My experience with them is that I have to support the support.
    >
    > Here's the details.
    >
    > Platform: ColdFusion MX on Windows.
    >
    > The website does NOT support sessions if the visitor is:
    > 1) Using a PC with Windows XP on a network with cookies enabled (me, and
    > probably low-level host tech support)
    > 2) Using a Mac that is not networked (my client at home)
    >
    > The website DOES support sessions if the visitor is:
    > 1) Using a PC with Windows, possibly networked (my client at work, and
    > probably high-level host tech support)).
    >
    > Note: My client doesn't know whether his computer at work is networked. I
    > didn't ask the host tech support whether they were networked, but I assume they
    > are. Each time I've talked with low-level tech support people, they see that
    > sessions are not working. But then they pass the ticket up to high-level techs
    > (that I can't talk to) who say sessions are working fine.
    >
    > At any rate, there's enough information here to eliminate networks, cookies
    > and PCs vs. Macs as the determining factor here.
    >
    > I made a test system, and put it on two sites: my client's site on CF MX
    > (where sessions sometimes don't work), and another site on CF 8 (where sessions
    > always do work).
    >
    > Site A) Here's the test on the site where sessions sometimes DON'T work.
    >
    > http://birdprecision.com/z-test-sessions-1.cfm

    You're trying to set cookies on the .com domain (which is not allowed):

    CFID=2679707;domain=.com;expires=Sat, 01-Jan-2039 11:03:25 GMT;path=/

    --
    Mack