Store cookies in browser cache

Discussion in 'ASP .Net' started by Dst, May 23, 2006.

  1. Dst

    Dst Guest

    I'm trying to interact with some old asp code.
    I'm logging into the asp page by posting username/password to the asp
    page
    using webrequest / webresponse.

    Now this works ok, the response back is a successful login, and i also
    get a cookie.
    Is it possible to save this cookie in the browser cache somehow ?
    I want the cookie to be persistent once executed..
    Because after the login, i want to transfer to a new asp page and
    forget about
    the cookie.

    I'm posting this from a webform using VisualStudio 2005.

    I dont know much about cookies so i need some help on the basics :).
    Dst, May 23, 2006
    #1
    1. Advertising

  2. Dst

    Hans Kesting Guest

    > I'm trying to interact with some old asp code.
    > I'm logging into the asp page by posting username/password to the asp
    > page
    > using webrequest / webresponse.
    >
    > Now this works ok, the response back is a successful login, and i also
    > get a cookie.
    > Is it possible to save this cookie in the browser cache somehow ?
    > I want the cookie to be persistent once executed..
    > Because after the login, i want to transfer to a new asp page and
    > forget about
    > the cookie.
    >
    > I'm posting this from a webform using VisualStudio 2005.
    >
    > I dont know much about cookies so i need some help on the basics :).


    Cookies are automatically stored (if the browser settings allow it) if
    you supply an expiry date. No expiry date = temporary cookie, to be
    forgotten when the browser closes.
    A second thing about cookies: they are only returned to the originating
    server. With one exception: if you send the cookie from
    "www.domain.com" but set the cookie domain to just "domain.com" (needs
    at least one ".") then a "other.domain.com" will also receive it.

    Hans Kesting
    Hans Kesting, May 24, 2006
    #2
    1. Advertising

  3. Dst

    Dst Guest

    Yes, but the page is not executed in the browser.
    I'm using System.Net.WebRequest.
    I read the page into a string, and the cookie into a string.
    Serverside code.

    Not sure how i can fire the browser with the retrieved cookie...
    Is it possible to create a login succeded page and redirect to that
    page
    after retrieveing the cookie ? Not sure how i can set the cookie for
    that page either.
    So that it will be executed in the browser...

    I tried InternetSetCookie, and this works on my computer when debugging
    locally.
    But of course not on a server, that will only create the cookie on the
    remote
    server since the code is executed server side.

    Dst
    Dst, May 24, 2006
    #3
    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. =?Utf-8?B?UnVkeQ==?=

    to store or not to store an image

    =?Utf-8?B?UnVkeQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    636
    =?Utf-8?B?UnVkeQ==?=
    Mar 30, 2005
  2. Paul W
    Replies:
    4
    Views:
    7,806
    Nick Gilbert
    Jun 2, 2005
  3. _Who
    Replies:
    7
    Views:
    2,659
  4. Edward Diener
    Replies:
    11
    Views:
    435
    Bart Van der Donck
    Oct 26, 2007
  5. Daniish
    Replies:
    0
    Views:
    138
    Daniish
    Jun 13, 2008
Loading...

Share This Page