{"id":1782,"date":"2023-02-06T20:49:57","date_gmt":"2023-02-06T11:49:57","guid":{"rendered":"https:\/\/ptune.jp\/tech\/?p=1782"},"modified":"2023-02-06T20:51:57","modified_gmt":"2023-02-06T11:51:57","slug":"cookie-add","status":"publish","type":"post","link":"https:\/\/ptune.jp\/tech\/cookie-add\/","title":{"rendered":"\u30b7\u30ca\u30ea\u30aa\u4f5c\u6210#ex3_Cookie\u60c5\u5831\u3092\u660e\u793a\u7684\u306b\u8ffd\u52a0\u3059\u308b"},"content":{"rendered":"<p>Cookie\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u5272\u308a\u5f53\u3066\u3089\u308c\u305fCookie\u60c5\u5831\u3092\u81ea\u52d5\u7684\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u306a\u304c\u3089\u3001JMeter\u304b\u3089\u660e\u793a\u7684\u306bCookie\u60c5\u5831\u3092\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u660e\u793a\u7684\u306bCookie\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>\u60f3\u5b9a\u30b7\u30c1\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u3068\u8ab2\u984c<\/h2>\n<p>\u300c\u7279\u5b9a\u306e\u60c5\u5831\u304cCookie\u306b\u5165\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u300d\u306e\u30b7\u30b9\u30c6\u30e0\u306e\u8ca0\u8377\u30c6\u30b9\u30c8\u3092\u3059\u308b\u5834\u5408\u3084WebAPI\u306e\u30c6\u30b9\u30c8\u3092\u3059\u308b\u5834\u5408\u3001\u660e\u793a\u7684\u306bCookie\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Cookie\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3078\u306e\u8a2d\u5b9a\u306f\u521d\u671f\u5024\u8a2d\u5b9a\u306e\u307f\u3068\u306a\u308b\u306e\u3067\u3001\u30b7\u30ca\u30ea\u30aa\u9014\u4e2d\u3067Cookie\u60c5\u5831\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<\/p>\n<h2>BeanShellPreProcessor\u3092\u4f7f\u3063\u3066\u8a2d\u5b9a<\/h2>\n<p>\u30b7\u30ca\u30ea\u30aa\u9014\u4e2d\u3067\u660e\u793a\u7684\u306bCookie\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001BeanShellPreProcessor\u3092\u4f7f\u3063\u3066\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-java\">import org.apache.jmeter.protocol.http.control.CookieManager;\nimport org.apache.jmeter.protocol.http.control.Cookie;\n\n\/\/ sampler\u304b\u3089CookieManager\u3092\u53d6\u5f97\nCookieManager cm = sampler.getCookieManager();\n\n\/\/ Cookie\u3092\u751f\u6210\nString domain=&quot;hogehoge.com&quot;;\nString auth_token=&quot;token_token_token&quot;;\nCookie cookie_token = new Cookie(&quot;token&quot;,token , domain, &quot;\/&quot;, false, 0);\n\n\/\/ CookieManager\u306b\u8ffd\u52a0\ncm.add(cookie_token);\n<\/code><\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u30b7\u30ca\u30ea\u30aa\u9014\u4e2d\u3067Cookie\u3078\u660e\u793a\u7684\u306b\u60c5\u5831\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001BeanShellPreProcessor\u7b49\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f7f\u3046\u30b1\u30fc\u30b9\u306f\u307e\u308c\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cookie\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u5272\u308a\u5f53\u3066\u3089\u308c\u305fCookie\u60c5\u5831\u3092\u81ea\u52d5\u7684\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u306a\u304c\u3089\u3001JMeter\u304b\u3089\u660e\u793a\u7684\u306bCookie\u60c5\u5831\u3092\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u660e\u793a\u7684\u306bCookie\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002 \u60f3\u5b9a\u30b7\u30c1\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u3068\u8ab2\u984c &#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/ptune.jp\/tech\/cookie-add\/\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":2,"featured_media":1806,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[8],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u30b7\u30ca\u30ea\u30aa\u4f5c\u6210#ex3_Cookie\u60c5\u5831\u3092\u660e\u793a\u7684\u306b\u8ffd\u52a0\u3059\u308b - pTune.jp<\/title>\n<meta name=\"description\" content=\"\u30b7\u30ca\u30ea\u30aa\u9014\u4e2d\u3067Cookie\u3078\u660e\u793a\u7684\u306b\u60c5\u5831\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001BeanShellPreProcessor\u7b49\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ptune.jp\/tech\/cookie-add\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u30b7\u30ca\u30ea\u30aa\u4f5c\u6210#ex3_Cookie\u60c5\u5831\u3092\u660e\u793a\u7684\u306b\u8ffd\u52a0\u3059\u308b - pTune.jp\" \/>\n<meta property=\"og:description\" content=\"\u30b7\u30ca\u30ea\u30aa\u9014\u4e2d\u3067Cookie\u3078\u660e\u793a\u7684\u306b\u60c5\u5831\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001BeanShellPreProcessor\u7b49\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ptune.jp\/tech\/cookie-add\/\" \/>\n<meta property=\"og:site_name\" content=\"pTune.jp\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-06T11:49:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-06T11:51:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ptune.jp\/tech\/wp-content\/uploads\/2023\/02\/cookie.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2395\" \/>\n\t<meta property=\"og:image:height\" content=\"2013\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ptune.jp\/tech\/#website\",\"url\":\"https:\/\/ptune.jp\/tech\/\",\"name\":\"pTune.jp\",\"description\":\"\\u30c7\\u30a3\\u30fc\\u30cd\\u30c3\\u30c8\\u304c\\u8ca0\\u8377\\u30c6\\u30b9\\u30c8\\u3084JMeter\\u306e\\u4f7f\\u3044\\u65b9\\u306b\\u3064\\u3044\\u3066\\u306e\\u60c5\\u5831\\u3092\\u767a\\u4fe1\\u3057\\u3066\\u3044\\u307e\\u3059\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ptune.jp\/tech\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ptune.jp\/tech\/cookie-add\/#primaryimage\",\"inLanguage\":\"ja\",\"url\":\"https:\/\/ptune.jp\/tech\/wp-content\/uploads\/2023\/02\/cookie.png\",\"contentUrl\":\"https:\/\/ptune.jp\/tech\/wp-content\/uploads\/2023\/02\/cookie.png\",\"width\":2395,\"height\":2013},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ptune.jp\/tech\/cookie-add\/#webpage\",\"url\":\"https:\/\/ptune.jp\/tech\/cookie-add\/\",\"name\":\"\\u30b7\\u30ca\\u30ea\\u30aa\\u4f5c\\u6210#ex3_Cookie\\u60c5\\u5831\\u3092\\u660e\\u793a\\u7684\\u306b\\u8ffd\\u52a0\\u3059\\u308b - pTune.jp\",\"isPartOf\":{\"@id\":\"https:\/\/ptune.jp\/tech\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ptune.jp\/tech\/cookie-add\/#primaryimage\"},\"datePublished\":\"2023-02-06T11:49:57+00:00\",\"dateModified\":\"2023-02-06T11:51:57+00:00\",\"author\":{\"@id\":\"https:\/\/ptune.jp\/tech\/#\/schema\/person\/2a166a5a51d8bf23ea6b328ba14a7fe0\"},\"description\":\"\\u30b7\\u30ca\\u30ea\\u30aa\\u9014\\u4e2d\\u3067Cookie\\u3078\\u660e\\u793a\\u7684\\u306b\\u60c5\\u5831\\u8ffd\\u52a0\\u3059\\u308b\\u306b\\u306f\\u3001BeanShellPreProcessor\\u7b49\\u3092\\u4f7f\\u3046\\u5fc5\\u8981\\u304c\\u3042\\u308a\\u307e\\u3059\\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/ptune.jp\/tech\/cookie-add\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ptune.jp\/tech\/cookie-add\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ptune.jp\/tech\/cookie-add\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ptune.jp\/tech\/\",\"url\":\"https:\/\/ptune.jp\/tech\/\",\"name\":\"\\u30db\\u30fc\\u30e0\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@id\":\"https:\/\/ptune.jp\/tech\/cookie-add\/#webpage\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ptune.jp\/tech\/#\/schema\/person\/2a166a5a51d8bf23ea6b328ba14a7fe0\",\"name\":\"\\u6d45\\u898b \\u76f4\\u4eba\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ptune.jp\/tech\/#personlogo\",\"inLanguage\":\"ja\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7975f2b224ebcb60f67b80c232d9e6f7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7975f2b224ebcb60f67b80c232d9e6f7?s=96&d=mm&r=g\",\"caption\":\"\\u6d45\\u898b \\u76f4\\u4eba\"},\"url\":\"https:\/\/ptune.jp\/tech\/author\/azami\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","jetpack_featured_media_url":"https:\/\/ptune.jp\/tech\/wp-content\/uploads\/2023\/02\/cookie.png","jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/posts\/1782"}],"collection":[{"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/comments?post=1782"}],"version-history":[{"count":2,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/posts\/1782\/revisions"}],"predecessor-version":[{"id":1804,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/posts\/1782\/revisions\/1804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/media\/1806"}],"wp:attachment":[{"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/media?parent=1782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/categories?post=1782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ptune.jp\/tech\/wp-json\/wp\/v2\/tags?post=1782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}