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. General Programming
  3. C#
  4. Cookie

Cookie

Scheduled Pinned Locked Moved C#
questionhtmlcomtutorial
5 Posts 2 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.
  • M Offline
    M Offline
    Moon Boy
    wrote on last edited by
    #1

    Hi, i wanna know how can i get a cookie for example: mypage.com/login.html This, have a form to login, so: mypage.com/login.html?user=teste&pass=test Will login with User= teste and Pass = test Im just trying to get the COOKIE, provided by login.html after the login. What can i use? Thanks

    H M 2 Replies Last reply
    0
    • M Moon Boy

      Hi, i wanna know how can i get a cookie for example: mypage.com/login.html This, have a form to login, so: mypage.com/login.html?user=teste&pass=test Will login with User= teste and Pass = test Im just trying to get the COOKIE, provided by login.html after the login. What can i use? Thanks

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      First of all, this really belongs in the Web Developer forum. This forum is for questions relating to C#, which can be used to create ASP.NET web applications that parse, compile, and execute code on the server so format and stream HTML to (and other files) to the browser or other client application using HTTP. Second, if you want to use ASP.NET, then by default the pages use the .aspx extension, not .html. Third, by using .html extensions, you are implying that you want to do this using client-side scripting, since .html is, by default, not a CGI-parsed extension on any system without actually remapping file extensions. Fourth, are you kidding? Passing the username and password in a query string is the most insecure method ever conceived! You might as well eliminate authentication. You pass username and passwords using POST (not GET) and you should use SSL over HTTP (HTTPS) if this is sensitive information. Even without using SSL, using POST at least doesn't store the username and password in the browser's history like this would. After taking all that above into account, how you do this depends on what server you're using and lots of other information. Again, I suggest you ask this in the Web Developers forum.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      • M Moon Boy

        Hi, i wanna know how can i get a cookie for example: mypage.com/login.html This, have a form to login, so: mypage.com/login.html?user=teste&pass=test Will login with User= teste and Pass = test Im just trying to get the COOKIE, provided by login.html after the login. What can i use? Thanks

        M Offline
        M Offline
        Moon Boy
        wrote on last edited by
        #3

        Well, u dont understand... I trying to acess a protected page with HttpWebRequest...but i need get the cookie first, to put in the CookieCollection :\

        H 1 Reply Last reply
        0
        • M Moon Boy

          Well, u dont understand... I trying to acess a protected page with HttpWebRequest...but i need get the cookie first, to put in the CookieCollection :\

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          Moon Boy wrote: Well, u dont understand No, it's you that don't understand. First of all, this isn't even using cookies. This is a query string, and if you have questions about ASP.NET (which your URLs didn't show at all, since they use the .html files which are typically staticly delivered on the server) they belong in the ASP.NET forum. If you're using the HttpWebRequest to access this site, then you need to pass the query string parameters as part of the URL. If the site is using cookies, then instantiate a new CookieContainer and add a Cookie. The documentation for the HttpWebRequest.CookieContainer property in the .NET Framework SDK even gives an example of how to do this. Consulting the documentation should be the first place you check. Also, when you want to reply to someone in the CodeProject forums, click "Reply" on the message to which you want to reply.

          Microsoft MVP, Visual C# My Articles

          M 1 Reply Last reply
          0
          • H Heath Stewart

            Moon Boy wrote: Well, u dont understand No, it's you that don't understand. First of all, this isn't even using cookies. This is a query string, and if you have questions about ASP.NET (which your URLs didn't show at all, since they use the .html files which are typically staticly delivered on the server) they belong in the ASP.NET forum. If you're using the HttpWebRequest to access this site, then you need to pass the query string parameters as part of the URL. If the site is using cookies, then instantiate a new CookieContainer and add a Cookie. The documentation for the HttpWebRequest.CookieContainer property in the .NET Framework SDK even gives an example of how to do this. Consulting the documentation should be the first place you check. Also, when you want to reply to someone in the CodeProject forums, click "Reply" on the message to which you want to reply.

            Microsoft MVP, Visual C# My Articles

            M Offline
            M Offline
            Moon Boy
            wrote on last edited by
            #5

            ;\ Sorry and thanks man

            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