Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. cooike problem

cooike problem

Scheduled Pinned Locked Moved ASP.NET
helpcomtutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    saravanan05
    wrote on last edited by
    #1

    hi friends i need to create the cookie in domain name.. For example: my cookie file named as "administrator@localhost.txt" but i need to create "administrator@mydomainname.txt" i tried like this Dim objcookies As HttpCookie = New HttpCookie("SalesLogin") objcookies.Domain="www.mydomain.com" but it is not created... can any one help me?

    Known Is Drop.Unknown Is Ocean

    P B 2 Replies Last reply
    0
    • S saravanan05

      hi friends i need to create the cookie in domain name.. For example: my cookie file named as "administrator@localhost.txt" but i need to create "administrator@mydomainname.txt" i tried like this Dim objcookies As HttpCookie = New HttpCookie("SalesLogin") objcookies.Domain="www.mydomain.com" but it is not created... can any one help me?

      Known Is Drop.Unknown Is Ocean

      P Offline
      P Offline
      Pranay Rana
      wrote on last edited by
      #2

      Following is way to create cookie in asp.net 1.HttpCookie objCookie = new HttpCookie(cookiename); 2.Response.Cookies.Add(objCookie); 3.objCookie.Values.Add(cookiename,cookievalue); i think you forget second line of the code which add cookie to respose

      S 1 Reply Last reply
      0
      • P Pranay Rana

        Following is way to create cookie in asp.net 1.HttpCookie objCookie = new HttpCookie(cookiename); 2.Response.Cookies.Add(objCookie); 3.objCookie.Values.Add(cookiename,cookievalue); i think you forget second line of the code which add cookie to respose

        S Offline
        S Offline
        saravanan05
        wrote on last edited by
        #3

        thanks for reply Dim objcookies As HttpCookie = New HttpCookie("SalesLogin") objcookies.Domain = Request.ServerVariables("HTTP_HOST") objcookies.Secure = True objcookies.Values.Add("AdminType", Session("AdminType")) objcookies.Values.Add("AdminId", Session("AdminId")) objcookies.Expires = DateTime.Now.AddDays(1) Response.Cookies.Add(objcookies) thisis my code

        Known Is Drop.Unknown Is Ocean

        P 1 Reply Last reply
        0
        • S saravanan05

          thanks for reply Dim objcookies As HttpCookie = New HttpCookie("SalesLogin") objcookies.Domain = Request.ServerVariables("HTTP_HOST") objcookies.Secure = True objcookies.Values.Add("AdminType", Session("AdminType")) objcookies.Values.Add("AdminId", Session("AdminId")) objcookies.Expires = DateTime.Now.AddDays(1) Response.Cookies.Add(objcookies) thisis my code

          Known Is Drop.Unknown Is Ocean

          P Offline
          P Offline
          Pranay Rana
          wrote on last edited by
          #4

          chek bwlow link hope this will do some work for you http://forums.asp.net/p/1242647/2275159.aspx#2275159[^]

          1 Reply Last reply
          0
          • S saravanan05

            hi friends i need to create the cookie in domain name.. For example: my cookie file named as "administrator@localhost.txt" but i need to create "administrator@mydomainname.txt" i tried like this Dim objcookies As HttpCookie = New HttpCookie("SalesLogin") objcookies.Domain="www.mydomain.com" but it is not created... can any one help me?

            Known Is Drop.Unknown Is Ocean

            B Offline
            B Offline
            Brij
            wrote on last edited by
            #5

            Also just have a look

            Cheers!! Brij

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups