<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://powerui.kulestar.com/wiki/index.php?action=history&amp;feed=atom&amp;title=HTTP_Cookies</id>
		<title>HTTP Cookies - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://powerui.kulestar.com/wiki/index.php?action=history&amp;feed=atom&amp;title=HTTP_Cookies"/>
		<link rel="alternate" type="text/html" href="https://powerui.kulestar.com/wiki/index.php?title=HTTP_Cookies&amp;action=history"/>
		<updated>2026-06-04T03:23:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://powerui.kulestar.com/wiki/index.php?title=HTTP_Cookies&amp;diff=58&amp;oldid=prev</id>
		<title>151.229.186.156: Created page with &quot;Whenever a website creates one or more cookies, they will be stored into a CookieJar (a C# class). Importantly, &#039;&#039;&#039;they are not persistent by default&#039;&#039;&#039;. PowerUI is, after all...&quot;</title>
		<link rel="alternate" type="text/html" href="https://powerui.kulestar.com/wiki/index.php?title=HTTP_Cookies&amp;diff=58&amp;oldid=prev"/>
				<updated>2017-01-13T21:28:41Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Whenever a website creates one or more cookies, they will be stored into a CookieJar (a C# class). Importantly, &amp;#039;&amp;#039;&amp;#039;they are not persistent by default&amp;#039;&amp;#039;&amp;#039;. PowerUI is, after all...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Whenever a website creates one or more cookies, they will be stored into a CookieJar (a C# class). Importantly, &amp;#039;&amp;#039;&amp;#039;they are not persistent by default&amp;#039;&amp;#039;&amp;#039;. PowerUI is, after all, a UI framework. Cookie jars are stored in memory and there&amp;#039;s one per host. In order to obtain the cookie jar for a particular host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// string host=&amp;quot;powerui.kulestar.com&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
PowerUI.Http.CookieJar jar = PowerUI.Http.CookieJar.Get(host);&lt;br /&gt;
&lt;br /&gt;
// jar is null if the host has set no cookies.&lt;br /&gt;
// It may be for a parent host (e.g kulestar.com) if no more specific one is found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cookie Jars and persistence ==&lt;br /&gt;
&lt;br /&gt;
Cookie jars have a ToString() method which will format all the cookies it holds into a storable cookie header. Save that string however you want, e.g. in PlayerPrefs. Reloading the jar is a little harder but can be roughly done like so:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// string host;&lt;br /&gt;
// string cookies;&lt;br /&gt;
&lt;br /&gt;
// Create the jar:&lt;br /&gt;
PowerUI.Http.CookieJar jar = PowerUI.Http.CookieJar.Get(host,true);&lt;br /&gt;
&lt;br /&gt;
// Get all the cookies:&lt;br /&gt;
string[] allCookies = cookies.Split(&amp;#039;;&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
// Add each one:&lt;br /&gt;
foreach(string cookie in allCookies){&lt;br /&gt;
&lt;br /&gt;
    // Add it:&lt;br /&gt;
    jar.Add(new Cookie(cookie));&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>151.229.186.156</name></author>	</entry>

	</feed>