Access cookies set by another application

Discussion in 'Javascript' started by prasannakate@gmail.com, Dec 8, 2008.

  1. Guest

    We have two web applications A and B, user logins into application A
    and we have implemented single sign on, so he also gets logged in to
    application B.
    Now we want to logout the user from application B, whenever he logs
    out from application A.

    We think deleting the JSESSION ID cookie set by application B will
    solve the problem.
    But we are not able to access the cookies set by B in A.

    Does any one know how can I access the cookies set by another web
    application in my web application. Both these applications are web
    based and controlled by us.
     
    , Dec 8, 2008
    #1
    1. Advertising

  2. wrote:
    > Does any one know how can I access the cookies set by another web
    > application in my web application. Both these applications are web
    > based and controlled by us.


    Set the `domain' or `path' parameters of the cookie or the deletion request
    accordingly, and make sure that protocols and `secure' flags match.

    Given the correct parameters, matching protocols and `secure' flags, cookies
    set for the domain `foo.bar' can be accessed/modified/deleted by a resource
    accessed via the domains `foo.bar' or `baz.foo.bar'. Cookies set for the
    path `/foo/bar' can be accessed/modified/deleted by a resource accessed via
    the paths `/foo/bar' or `/foo/bar/baz'.

    For example, a deletion request in `http://baz.foo.bar/' for the cookie
    named `baz' that had been set for the domain `foo.bar':

    document.cookie = "baz=42; domain=foo.bar; expires=" + (new Date(0));

    The `domain' and `path' parameters of a cookie are set implicitly according
    to the request URI of the document if you don't provide them.


    PointedEars
    --
    Use any version of Microsoft Frontpage to create your site.
    (This won't prevent people from viewing your source, but no one
    will want to steal it.)
    -- from <http://www.vortex-webdesign.com/help/hidesource.htm>
     
    Thomas 'PointedEars' Lahn, Dec 8, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,572
    Hans Kesting
    Feb 3, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    6,579
    Fredrik Lindner
    Nov 6, 2003
  3. user
    Replies:
    3
    Views:
    687
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Mar 31, 2007
  4. _Who
    Replies:
    7
    Views:
    2,747
  5. Phil Powell
    Replies:
    2
    Views:
    217
    Grant Wagner
    Sep 5, 2003
Loading...

Share This Page