Cookies gets deleted in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arulmanoj
    New Member
    • Mar 2009
    • 34

    Cookies gets deleted in asp.net

    Hi,

    I am using cookies in asp.net web applicaiton to store the referrer name for 50 days. When the user login to the web application the referrer value from the URL is stored into a Cookie with Expiry date as 50 days.

    But when the user logout from the web application this cookie gets cleared. In the logout button I have used below lines.
    Session.Abandon ();
    Response.Cookie s.Add(new HttpCookie("ASP .NET_SessionId" , ""));

    Now i don't want to delete this cookie on logout.
    Any help will be appreciated.

    Thanks.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Use a cookie that isn't the SessionID.
    In other words, create a new cookie for the purpose of retrieving the referrer.

    Be aware that some people set the browser to clear all cookies upon closing (I do).

    -Frinny

    Comment

    • Arulmanoj
      New Member
      • Mar 2009
      • 34

      #3
      Working now

      Hi Frinny,

      Thanks for the reply, I have kept cookie name as Referrername.

      Thanks.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Did that fix your problem?

        -Frinny

        Comment

        Working...