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. Selecting one value from a cookie

Selecting one value from a cookie

Scheduled Pinned Locked Moved C#
questionhelp
2 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.
  • _ Offline
    _ Offline
    _Searcher_
    wrote on last edited by
    #1

    Hello! I'm having some trouble geting one value (and only one) from my cookie, and would realy appreciate some help. This is my code: HttpCookie UserCookie; UserCookie = new HttpCookie( "strUserID" ); UserCookie.Values.Add("group", "1"); UserCookie.Values.Add("sim", "2"); Response.Cookies.Add( UserCookie ); How do I get only "group"? Thanks! -- Evil geniuses for a better tomorrow --

    H 1 Reply Last reply
    0
    • _ _Searcher_

      Hello! I'm having some trouble geting one value (and only one) from my cookie, and would realy appreciate some help. This is my code: HttpCookie UserCookie; UserCookie = new HttpCookie( "strUserID" ); UserCookie.Values.Add("group", "1"); UserCookie.Values.Add("sim", "2"); Response.Cookies.Add( UserCookie ); How do I get only "group"? Thanks! -- Evil geniuses for a better tomorrow --

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

      If you read the documentation for the Response.Cookies property (rather, the HttpCookieCollection class that Response.Cookies reflects), it should be obvious:

      string group = Response.Cookies["group"];

      Microsoft MVP, Visual C# My Articles

      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