Results 1 to 13 of 13

Thread: Access Cookie

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Access Cookie

    Hi,
    I have 2 web application hosted on 2 separate servers.In first application i had one anchor tag whose target=_None and href="url of 2nd application"

    Is it possible to access the cookie which is created by first application in second application ? if yes how?

    Any help on this.........

    Regards,
    Ritesh
    Last edited by riteshjain1982; May 28th, 2007 at 11:33 AM.

  2. #2
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    354

    Re: Access Cookie

    no, cookies are on a per site basis.

    you could pass the cookie parameters in the address http://myapp.net/?var1=red?var2=blue

    or something along those lines. If there is security concerns just encrypt variables.

    The other option is to a db driven application and just have both you apps pull from a the db.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Access Cookie

    Thanks for reply............ but as i mentioned for some reason i have to use anchor tag to redirect the url and in that i can not pass the parameter using

    href=http://abc.com?a=document.cookie ......


    i am wondering when browser open the new window for redirected URL is the case of parent - child form and if so can't i access the cookie information of calling page (parent)


    Regards,
    Ritesh

  4. #4
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    354

    Re: Access Cookie

    Quote Originally Posted by riteshjain1982
    Thanks for reply............ but as i mentioned for some reason i have to use anchor tag to redirect the url and in that i can not pass the parameter using

    href=http://abc.com?a=document.cookie ......


    i am wondering when browser open the new window for redirected URL is the case of parent - child form and if so can't i access the cookie information of calling page (parent)


    Regards,
    Ritesh


    ....so pass your params using an anchor tag.

    Code:
    <a id="myID" href="javascript:openNewWinFunction()">Text to be displayed</a>
    why do you have to use anchor tags? You could do it with asp.net as well.

    You posting in an asp.net forum, so I am assuming you ca populate the page dynamically.

    Code:
    <asp:HyperLink id="value" Runat="Server"
      ImageUrl="url"
      NavigateUrl="url"
      Target="_blank|_self|_top|_parent|framename"
      Text="string"
        property="value"
        Style="CSS style settings..."
      />
    Last edited by superbovine; May 29th, 2007 at 05:11 PM.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Access Cookie

    You have to pass some information to the other website. It's either that, or have the other website work on another port under the same domain name.

    Example:

    www.abc.com
    and
    www.abc.com:82

    That way, both apps can look at the same cookie.

    Otherwise, store it in a database. When redirecting, pass it an ID which the other app can use to query the same database and create a cookie.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Access Cookie

    thanks superbovine and Mendhak for your suggestion.....but unfortunately i dont have much control rather no direct control over 1st web application (not even to write any jscript on that) except the fact that i can only place one Anchor tab........... i tried using href = http://abc.com?a=document.cookie; as well as tried to see all possible propert of request object in target page (child page) but no luck...........

    any other clue will be help full

    PS:Its sort of advertisement link on 1st web app when user click on it will redirect it to other page,and 1st web app stored users color schema and other settings in cookie but i know the key in which those values are stored.....

  7. #7
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Access Cookie

    Mendhak answered your question precisely. You have one anchor tag to place, so add a parameter in that redirect for the second application to work from. Look at the URL's when navigating the forums. The root always stays the same, but the content is constantly changing, because it's being passed different variables. You can do the same thing for your project. Make your anchor tag something like <a href="http://www.secondApp.com?var=42">Click Here</a>, and in www.secondApp.com, just tell the page how to handle the query string. It's not that difficult.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Access Cookie

    Hi Timeshifter.. thankx for reply.........but here the things is that both application are running under different domain name on diff servers........ and parent app where my anchor tag is, has no other info abt. target app other than url reside in href......and some how my anchor tag is suppose to capture cookie of parent and sent it to target may be in the form of parameter or ????........i hope u will get what i want to convey.....

  9. #9
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Access Cookie

    Not really.. but it still sounds like you just need to pass information from one page to another. What server it's on doesn't matter, as long as the recieving end knows what to do with it. Query strings are how that's done.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Access Cookie

    ok let's take for example i posted some link in this thread which will take user to this site http://www.mysite.com so i want to access the cookie value of this site (vbforum) which store user color scheme and other info, in my site.........i hope this will be clear my point.........

  11. #11
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    354

    Re: Access Cookie

    Quote Originally Posted by riteshjain1982
    ok let's take for example i posted some link in this thread which will take user to this site http://www.mysite.com so i want to access the cookie value of this site (vbforum) which store user color scheme and other info, in my site.........i hope this will be clear my point.........
    That isn't possible. There is no way around this.

  12. #12
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Access Cookie

    You're stuck. You will need more access to the first application than just being able to place a hyperlink on it. Or get the developers of the first application to generate the links for you. No other way.

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Access Cookie

    Thanks guys for u r input...........it seems like mission impossible ....

    while googling i came to know that what i want is something related to hacking and all stuff.....so i guess have to find some other way..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width