How to check for logged in status on a 3rd party site?

Options

I would like to be able to check whether or not a user is currently logged into convio from another website site. The site and the convio site would be subdomains of sierraclub.org

How might I accomplish this?

Can I check the cookie? If so what cookie name would I look for if so is there any information in it like username (I presume though that is likely only to be a session ID)?

I looked through the cookies from action.sierraclub.org (our convio site) and couldn't quite tell what I should check for.

Tagged:

Comments

  • Hoping someone from Convio might look at this!

  • Adrian Cotter:

    Hoping someone from Convio might look at this!

    Your site is currently configured with the multi-domain feature disabled, so it is pushing all cookies to action.sierraclub.org. I don't believe that these cookies will be visible from a page served from another sierraclub.org domain. If the site configuration is changed to push to sierraclub.org, then you should see a cookie name that starts with JServSessionId followed by some additional characters (e.g. JServSessionIdr005). This cookie would indicate that the user has an active session on the Convio powered site. I don't know if this is what you really want to know though. If you want to know if they are "logged in" vs. just visiting, you could look at the content of a PageServer page that just contains ] as its content. If you did that without checking for the cookie though, you would potentially log the person as you checked if they have a "remember me" cookie.

    Is this even close to what you're asking.

  • DavidHart :

    Your site is currently configured with the multi-domain feature disabled, so it is pushing all cookies to action.sierraclub.org. I don't believe that these cookies will be visible from a page served from another sierraclub.org domain. If the site configuration is changed to push to sierraclub.org, then you should see a cookie name that starts with JServSessionId followed by some additional characters (e.g. JServSessionIdr005). This cookie would indicate that the user has an active session on the Convio powered site. I don't know if this is what you really want to know though. If you want to know if they are "logged in" vs. just visiting, you could look at the content of a PageServer page that just contains ] as its content. If you did that without checking for the cookie though, you would potentially log the person as you checked if they have a "remember me" cookie.

    Is this even close to what you're asking.

    Hey Dave, thanks for the reply. I think you're talking about the right thing. We are going to have the Port networks working with Convio though, shortly. I presume that would mean we would have multi-domain turned on?

    So, assuming that it will be on, is the cookie number arbitrary to the user? Or is it defined at the site level? (i.e. how would I then access it)

    And then assuming I can access it, is the cookies mere presence an indication of a logged in state, or is a field within the cookie? If the latter, what would that field and value be?

    Thanks!

  • Adrian Cotter:

    Hey Dave, thanks for the reply. I think you're talking about the right thing. We are going to have the Port networks working with Convio though, shortly. I presume that would mean we would have multi-domain turned on?

    So, assuming that it will be on, is the cookie number arbitrary to the user? Or is it defined at the site level? (i.e. how would I then access it)

    And then assuming I can access it, is the cookies mere presence an indication of a logged in state, or is a field within the cookie? If the latter, what would that field and value be?

    Thanks!

    Yes, part of configuring the Port integration is to turn on the multi-domain cookies. The numbers at the end of the cookie name are based on the "zone" that your site is running in. The zone is the equivalent of an application version number but drawn from a small pool that we rotate through. It will be the same for every user but will change every few weeks as patches are applied.

    The presence of the cookie indicates an active session - no need to interrogate any data within it. It is not a permanent cookie and will be deleted when the session ends. The contents of the cookie is just a random nonce that the web server uses to associate requests back to the same session.

  • DavidHart :

    Yes, part of configuring the Port integration is to turn on the multi-domain cookies. The numbers at the end of the cookie name are based on the "zone" that your site is running in. The zone is the equivalent of an application version number but drawn from a small pool that we rotate through. It will be the same for every user but will change every few weeks as patches are applied.

    The presence of the cookie indicates an active session - no need to interrogate any data within it. It is not a permanent cookie and will be deleted when the session ends. The contents of the cookie is just a random nonce that the web server uses to associate requests back to the same session.

    Hey Dave,

    I just reread this today... if the cookie name is changing every few weeks this makes things a tad difficult. Is there any way we can know what that name is without having to find it out manually?

  • Adrian Cotter:

    Hey Dave,

    I just reread this today... if the cookie name is changing every few weeks this makes things a tad difficult. Is there any way we can know what that name is without having to find it out manually?

    No, it follows a pattern of always startign with JServSessionId, but it changes pretty often.

    I spoke with some folks from the Port yesterday, and I may have a different tact on the problem though. I don't really think you want to know if someone is currently logged in; I think you want to know if someone is currently logged in or has a "remember me" cookie that could potentially log them in automatically. So, I've got a few questions for you:

    Is that really the question?

    Are you just looking to solve it for your Port integration or is this another system?

    If it's another system, can you modify the back-end code or just the client HTML?

  • DavidHart :

    Your site is currently configured with the multi-domain feature disabled, so it is pushing all cookies to action.sierraclub.org. I don't believe that these cookies will be visible from a page served from another sierraclub.org domain. If the site configuration is changed to push to sierraclub.org, then you should see a cookie name that starts with JServSessionId followed by some additional characters (e.g. JServSessionIdr005). This cookie would indicate that the user has an active session on the Convio powered site. I don't know if this is what you really want to know though. If you want to know if they are "logged in" vs. just visiting, you could look at the content of a PageServer page that just contains ] as its content. If you did that without checking for the cookie though, you would potentially log the person as you checked if they have a "remember me" cookie.

    Is this even close to what you're asking.

    Not to hijack this thread, but what is the "multi-domain feature"? Does this mean having Convio set cookies for .example.com vs. host.example.com? How/where is this configured?

    Also, how does Convio handles cookies for non-SSL (.example.com) and SSL (secure#.convio.net)?

  • DavidHart :

    No, it follows a pattern of always startign with JServSessionId, but it changes pretty often.

    I spoke with some folks from the Port yesterday, and I may have a different tact on the problem though. I don't really think you want to know if someone is currently logged in; I think you want to know if someone is currently logged in or has a "remember me" cookie that could potentially log them in automatically. So, I've got a few questions for you:

    Is that really the question?

    Are you just looking to solve it for your Port integration or is this another system?

    If it's another system, can you modify the back-end code or just the client HTML?

    Well just to layout the problem a little more clearly:

    • we have a non-convio non-port site associated with the social network (so we can modify the back-end code)

    • and we would like it to reflect the users state (so it gives a link to their account, and not the login/register buttons).

    • our login forms also exist on that that same server and if someone goes there who is already logged on, we would like to send them on back to the Port side of things.

    So, what you are suggesting might work, but what happens if they are logged in, but don't have a remember me cookie? My guess is they'd still see the login/register button.

    Thinking of other options:

    • Do away with the login/register buttons -- we could just have a link to the Port account page whereby they would be redirected if they don't happen to be logged in (or auto logged in)

    • Have the login go through another page that sets another cookie.

  • Robert Zakon:

    Not to hijack this thread, but what is the "multi-domain feature"? Does this mean having Convio set cookies for .example.com vs. host.example.com? How/where is this configured?

    Also, how does Convio handles cookies for non-SSL (.example.com) and SSL (secure#.convio.net)?

    Yes, setting a site up for multi-domain will change the cookies to come from a higher level like .example.com. It does a few other things as well, although I can't do a comprehensive list off the top of my head. Only a Convio employee (support analyst or project manager) will have access to this configuration option.

    The secure cookies are at a path level (e.g. secure#.convio.net/foo) since multiple clients are typically on the same secure server domain. The code keeps track of the different channels internally so it knows if it needs to push a cookie or not when you switch.

  • DavidHart :

    Yes, setting a site up for multi-domain will change the cookies to come from a higher level like .example.com. It does a few other things as well, although I can't do a comprehensive list off the top of my head. Only a Convio employee (support analyst or project manager) will have access to this configuration option.

    The secure cookies are at a path level (e.g. secure#.convio.net/foo) since multiple clients are typically on the same secure server domain. The code keeps track of the different channels internally so it knows if it needs to push a cookie or not when you switch.

    Thanks Dave. Since Convio SSL and non-SSL cookies are on different domains and cross-domain cookies are not permitted by browsers, is Convio passing a session ID around and setting two cookies? Feel free to follow up on the SSL & SSO thread so this one isn't cluttered up any further.

Categories