<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by William Chislett on Medium]]></title>
        <description><![CDATA[Stories by William Chislett on Medium]]></description>
        <link>https://medium.com/@williamchislett?source=rss-ac464573c32c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xDuO70z8V92yT-5AuPfhDA.jpeg</url>
            <title>Stories by William Chislett on Medium</title>
            <link>https://medium.com/@williamchislett?source=rss-ac464573c32c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:14:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@williamchislett/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Routing web traffic with IPTables]]></title>
            <link>https://medium.com/@williamchislett/routing-web-traffic-with-iptables-289e90116ce7?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/289e90116ce7</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[iptables]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Wed, 31 Jul 2024 16:45:16 GMT</pubDate>
            <atom:updated>2024-07-31T16:51:18.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wyTkkJBPMf09oO-zZCNdA.png" /></figure><p>To forward incoming web traffic on ports 80 and 443, add iptables rules for NAT (Network Address Translation) using the following commands:</p><pre># For forwarding http / 80 traffic to port 4000<br> sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 4000<br># For forwarding https / 443 traffic to port 5000<br>sudo iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port 5000</pre><p>To list the NAT prerouting rules that you’ve just setup, use the following command:</p><pre>sudo iptables -t nat -L PREROUTING -n -v --line-numbers</pre><p>To delete existing NAT prerouting rules, use the following:</p><pre># Where 1 is the line number of the rule seen when listing rules (see above)<br>sudo iptables -t nat -D PREROUTING 1</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=289e90116ce7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free HTTPS Certificates with LetsEncrypt and Certbot]]></title>
            <link>https://medium.com/@williamchislett/free-https-certificates-with-letsencrypt-and-certbot-a46e569fb126?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a46e569fb126</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[certificate]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Fri, 19 Jul 2024 22:43:44 GMT</pubDate>
            <atom:updated>2024-07-19T22:44:43.847Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V9pWQV2MQr3sC-k0" /><figcaption>Padlocks, because certs etc.</figcaption></figure><p>You can acquire a free HTTPS cert to enable HTTPS on your web application using the non-profit <a href="https://letsencrypt.org/getting-started/">Let’s Encrypt</a> and their tool <a href="https://certbot.eff.org/">Certbot</a>.</p><h4>Step 1: Install Certbot:</h4><p>The following steps are taken from some digging around Stackoverflow, however the official install instructions are to use snapd and can be found on the certbot site: <a href="https://certbot.eff.org/instructions">https://certbot.eff.org/instructions</a></p><pre>sudo yum update<br>sudo amazon-linux-extras install epel<br>sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm<br>sudo yum-config-manager --enable epel<br>sudo yum install certbot python3-certbot-nginx</pre><h4><strong>Step 2: Generate a certificate:</strong></h4><p>Once certbot is installed, it can be used to generate an https certificate for use with your web app.</p><p>Run the following to start the generation process:</p><pre>sudo certbot certonly --manual</pre><p>You’ll be asked to enter your domain e.g. mywebsite.com, and upon doing that<strong> you’ll be asked to create a file with specific contents that will be available via your domain</strong>. For example mywebsite.com/.well-known/acme-challenge/something-xyz-123 with contents abc123xyz456. For my NodeJS site I was able to create this in the static/public folder like so:</p><pre>cd my-public-dir-here<br>mkdir .well-known/acme-challenge<br>nano .well-known/acme-challenge/some-name-that-certbot-told-me-to-make<br># add the whatever Certbot told you to add via nano e.g. OQD_H4DzQSgx4t2GmJfr2nrRbFlaIe7rEmenM59QnwI.oVbnfoz9h_ezH1memiQY2qEfjLh6qol5JwaVUllMt58</pre><p>If certbot is able to access the file that you just created then it should verify that you’re the site’s owner and create two pem files for use with your application: <br><strong>fullchain.pem</strong> and <strong>privkey.pem</strong></p><h4>Step 3: Use the certificate and key in your application</h4><p>These two files can then be used with your web application, for example with NodeJS apps they can be passed to the https server via the options as follows:</p><pre>const https = require(&#39;https&#39;);<br>const httpsOptions = {<br>    key: fs.readFileSync(path.resolve(__dirname, &#39;certs/privkey.pem&#39;)),<br>    cert: fs.readFileSync(path.resolve(__dirname, &#39;certs/fullchain.pem&#39;))<br>};<br>https.createServer(httpsOptions, app).listen(5000);</pre><p>Restart the app and you should now see a valid certificate when accessing your application over https.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a46e569fb126" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing to Google Sheets API using .NET and a Services Account]]></title>
            <link>https://medium.com/@williamchislett/writing-to-google-sheets-api-using-net-and-a-services-account-91ee7e4a291?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/91ee7e4a291</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[google-api]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Sat, 27 Oct 2018 17:44:41 GMT</pubDate>
            <atom:updated>2018-11-04T20:11:41.352Z</atom:updated>
            <content:encoded><![CDATA[<h3>Writing to Google Sheets API using C# .NET and a Services Account</h3><p><strong>TLDR</strong>: Create a Google Service account with the service account user role; download credentials file; add the service account’s email address to write permissions on the sheet; scroll to the bottom of this page for the C# code for connecting/using the Sheets service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*cB5wORXkYnzBMgz_4Ncmzg.png" /><figcaption>This should work for the rest of the G-Suite APIs too…</figcaption></figure><ol><li>Create a new API project at <a href="https://console.developers.google.com/">https://console.developers.google.com/</a>.</li></ol><p>2. Go to the <a href="https://console.developers.google.com/apis/credentials">Google API credentials page</a>, click to “Create credentials” and select Service account key.</p><p>3. On the same credentials page, click to manage service accounts (link on right hand side, shown below):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LaviMmr9GyMxaSJ5y3kRRw.png" /></figure><p>4. Create a new service account if you don’t already have one. For <strong>Roles, </strong>assign it the Service Account User role:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3T6CgyFqRW2oe1E47SXyw.png" /></figure><p>5. Click to create a new key for this account, select JSON and it should download a JSON credential file for you.</p><p>6. Save the credentials file to the root of your project (or subfolder) and in Visual Studio set the property<strong> Copy to Output Path</strong> to <strong>“Copy Always”. Note that you shouldn’t make this file publicly available if it’s being used in a website solution.</strong></p><p>7. Copy the service account user’s email address, shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W1OsmVGoROSTCNNvM09IMA.png" /></figure><p>8. Add this email address to the Google sheet that you want to edit via the API; give it write permissions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*YQ-r-RFKbGva-pQ71xxy4g.png" /></figure><p>9. Add the Google Sheets API Nuget package to your .NET project.</p><p>10. Connect to the Google Service and write your data to a sheet using the API methods shown below. Use the sheet ID from the sheet’s URL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30982b5b42639e8c44d74cb4d5af36c7/href">https://medium.com/media/30982b5b42639e8c44d74cb4d5af36c7/href</a></iframe><p>Questions/comments/debates welcome…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91ee7e4a291" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging Sitecore with Visual Studio and DotPeek]]></title>
            <link>https://medium.com/@williamchislett/debugging-sitecore-with-visual-studio-cfe2ed12c782?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfe2ed12c782</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[debug]]></category>
            <category><![CDATA[sitecore]]></category>
            <category><![CDATA[visual-studio]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Thu, 20 Sep 2018 23:45:54 GMT</pubDate>
            <atom:updated>2018-09-24T21:15:56.549Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>TLDR</strong>: Decompile Sitecore DLLs and run a symbol server with DotPeek; make Visual Studio load symbols from the symbol server; add the full Sitecore method name to a new breakpoint in VS using: <em>Debug-&gt;New Breakpoint-&gt;Function Breakpoint.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JpLqtWAByONJlp9Y" /><figcaption>“silver and orange steel machine” by <a href="https://unsplash.com/@hansonlujx?utm_source=medium&amp;utm_medium=referral">Hanson Lu</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Sitecore does a lot of work behind the scenes in pipelines that are hidden away in DLLs. Sometimes it behaves like a big black box that throws out random exceptions without explanation. To make life easier and to help diagnose problems involving analytics, EXM, engagement plans, etc. you can hook up your local Sitecore instance to the Visual Studio debugger and step-through the actual Sitecore code.</p><h4>Decompile with DotPeek</h4><p>The first step is to download <a href="https://www.jetbrains.com/decompiler/">JetBrains DotPeek</a>, which will decompile Sitecore DLLs and let you look at the source code.</p><p>Once downloaded, use DotPeek to open any relevant Sitecore DLLs (found in the local /bin folder, usually). You can then click around inside the DLL contents and see all those ‘fun’ Sitecore classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XoPLhcesAHq59U3Bud7Gsg.png" /><figcaption>Sitecore DLLs are all named the same, of course.</figcaption></figure><blockquote>A note on finding the correct Sitecore DLL to decompile:</blockquote><blockquote>Check the logs, exception messages, errors etc. for the area of code you’re having problems with and look for any mentions of Sitecore code, e.g. “<em>Sitecore.Modules.Something.Foo.Bar”</em> and then look for a DLL with a matching or similar name.</blockquote><blockquote>If in doubt, open a load of Sitecore DLLs with DotPeek and use the search to narrow it down.</blockquote><blockquote>In this example I’m debugging code that is run as part of the <strong>DispatchNewsletter</strong><em> </em>pipeline, which is found in <strong>Sitecore.EmailCampaign.dll.</strong></blockquote><h4>Run the DotPeek Symbol Server</h4><p>Run DotPeek as a server that can provide symbols to Visual Studio by clicking the icon or going to:</p><p><strong>Click Tools -&gt; Symbol Server</strong></p><p>You can also find the symbol server URL at a later date by going to Tools -&gt; Options. Copy this localhost URL as it’s needed in Visual Studio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vd0fXBKMORkMpLisTRESZg.png" /><figcaption>Click the icon to run. Open options to find the URL.</figcaption></figure><h4>Start the Visual Studio Debugger and Load Symbols</h4><p>Go back to Visual Studio and add the symbol server to the list of symbol file locations in debug options:</p><p><strong>Tools -&gt; Options -&gt; Debugging -&gt; Symbols</strong></p><p>Add a new symbol file location and paste the symbol server URL in.</p><p>Loading all symbols seems to take a long time, so to speed it up select <strong><em>Only specified modules</em></strong> and click to<strong><em> Specify modules</em></strong>.</p><p>Add the name of the Sitecore DLL that contains the code you’re interested in debugging. In this case <strong><em>“Sitecore.EmailCampaign”</em></strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XxVZ1IOFKIWifn20Hsi64g.png" /><figcaption>Load symbols from the DotPeek symbols server</figcaption></figure><h4>Add a Breakpoint in Sitecore Code</h4><p>Visual Studio has a tool that allows you to insert a breakpoint anywhere, as long as you know the name of the function:</p><p><strong>Debug -&gt; New Breakpoint -&gt; Function Breakpoint</strong></p><p>Use this to break on the Sitecore method that you want to debug. Just add the full name of the method, including its namespace e.g. <strong>“Sitecore.Modules.EmailCampaign.Core.ItemUtilExt.ExecuteWorkflowCommandForItem”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*W0s45-NWrZyCTDBvC4kzGw.png" /><figcaption>Add the full method name, usually copied straight out of error logs…</figcaption></figure><p>Attach to the web process as normal (Debug -&gt; Attach to process -&gt; w3wp.exe) and you should hit and pause on the new break-point next time Sitecore runs that code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfe2ed12c782" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Useful Sitecore xDB, analytics and contact MongoDB Queries]]></title>
            <link>https://medium.com/@williamchislett/useful-sitecore-xdb-mongo-queries-155830561fd0?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/155830561fd0</guid>
            <category><![CDATA[robomongo]]></category>
            <category><![CDATA[sitecore]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Fri, 10 Aug 2018 21:52:30 GMT</pubDate>
            <atom:updated>2019-02-04T21:43:29.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_0i18PWzwgiz3BKM" /></figure><p>Some useful MongoDB queries for use against Sitecore collections (or just syntax help for Mongo querying). Some are for our custom Sitecore (8.2) facets so won’t be much use for anyone else…</p><h3>Contacts Collection</h3><p>Find records with a nested property that is longer than X characters:</p><pre>db.getCollection(‘Contacts’).find(<br>{“Addresses.Entries.Preferred.Country”:{$exists:true}, $where:”this.Addresses.Entries.Preferred.Country.length &lt; 10&quot;})</pre><p>Find a contact by identifier:</p><pre>db.getCollection(&#39;Contacts&#39;).find({&quot;Identifiers.Identifier&quot;: String.toLowerCase(&quot;2F270457-D0BC-4F2E-8483-A6788481AB2B&quot;)})</pre><p>Find contact by email address:</p><pre>db.getCollection(‘Contacts’).find({“Emails.Entries.Preferred.SmtpAddress”: {$exists : true}})</pre><p>Find contacts that have signed up to at lease one mailing list:</p><pre>db.getCollection(&#39;Contacts&#39;).find({&quot;Tags.Entries.ContactLists.Values.0.Value&quot;: {$exists: true}})</pre><p>Find contacts that have signed up to a mailing list before a certain date (considers first entry only):</p><pre>db.getCollection(&#39;Contacts&#39;).find({&quot;Tags.Entries.ContactLists.Values.0.DateTime&quot;: {$lt : new ISODate(&quot;2017-11-24-T00:00:00.000Z&quot;)} })</pre><h3>Interactions Collection</h3><p>Find goals of a particular type (by name — “Download” in this case) that were triggered within a certain time period:</p><pre>db.getCollection(‘Interactions’).find({“StartDateTime”: { <br>  $gte: ISODate(“2018–07–01T00:00:00.000Z”), <br>  $lt: ISODate(“2018–11–01T00:00:00.000Z”)}, <br>  Pages : {$elemMatch: {PageEvents:{$elemMatch:{Name: “Download”}}}} })</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=155830561fd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Down the rendering rabbit hole — finding items in Sitecore]]></title>
            <link>https://medium.com/@williamchislett/down-the-sitecore-rendering-rabbit-hole-a294e5ac526?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a294e5ac526</guid>
            <category><![CDATA[search]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[sitecore]]></category>
            <category><![CDATA[sitecore-development]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Fri, 06 Jul 2018 23:12:58 GMT</pubDate>
            <atom:updated>2018-07-27T18:04:19.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*L0EjOgYrMNnZJakO2CxMfA.png" /><figcaption>The endless clicking through content nodes.</figcaption></figure><p>Before fixing or modifying a site’s HTML, you need to be able to find how Sitecore is generating it. Sometimes you realize that HTML has come from a rendering linked to a datasource, set by a config file, output to a placeholder, via the Experience Editor… and only visible under certain personalization rules (you get the idea).</p><p>It’s also crucial to understand the knock-on effects of altering a .cshtml file, as Sitecore renderings can be reused in many locations, all over a site.</p><p>To help with this, here’s a list of techniques that can help understand how and where content is being generated:</p><p><strong>Use Sitecore’s Navigate -&gt; Links button.</strong></p><p>Select the relevant rendering or template in the content editor, click the “Navigate” tab and expand “Links” to see anywhere that this node is referenced. You can then click through to these items to find anything that references this rendering or template. <em>This is really useful for finding page events attached to an item!</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMg4TfrbHI3Sc_FdPsuFig.png" /><figcaption>This “Password Reset Form” template is referenced by placeholder settings and a content item.</figcaption></figure><p><strong>Use XPath Queries</strong></p><p>Sitecore’s content tree search field is ‘okay’ for quickly finding items, but the results are limited and don’t show you the full picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*XLVlDcYzQG7tdUW_ziY6gw.png" /><figcaption>Results are limited… and frustrating</figcaption></figure><p>For more thorough content searches, Sitecore has a built-in UI for running queries against its items. This is great for finding obscure content or understanding how changes to one item will impact others. To access it, go to:<a href="https://pmief-bau.durabledigital.com/sitecore/shell/default.aspx?xmlcontrol=IDE.XPath.Builder"><br><strong><em>&lt;site-url&gt;/sitecore/shell/default.aspx?xmlcontrol=IDE.XPath.Builder</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*P4HU8UMLQI4Hfk5L8M1f3g.png" /><figcaption>XPath Builder and fast search</figcaption></figure><p><a href="http://sitecoreworld.blogspot.com/2014/09/querying-items-from-sitecore.html">There are lots of syntax options</a> for a search, but a good start is to quickly look for any items by name. For example, to find anything related to “Login” functionality (note, use lowercase “login” with the @@key option):</p><pre>fast:/sitecore//*[@@key=&quot;%login%&quot;]</pre><p><strong>Check serialized files for references.</strong></p><p>Use the serialized files to find all references to a rendering or template. Get the rendering item’s Sitecore ID and search the Unicorn (or TDS/Sitecore) .yml files for occurrences. Files in the content section are usually most useful and can help understand where a rendering is used and what impact changing it will have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pdeBVkOXIEZVpylcTqbKyA.png" /></figure><p><strong>Inspect the element and global find</strong></p><p>This is usually the first port of call in a regular MVC project (not so much in a Sitecore application!). Inspect the HTML element and then global search for it in the IDE. If you can’t find the element itself anywhere, then use some nearby distinctive HTML (i.e. don’t go searching for “&lt;div&gt;”)…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a294e5ac526" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Abandoning a Sitecore session]]></title>
            <link>https://medium.com/@williamchislett/abandoning-a-sitecore-session-921761d410ca?source=rss-ac464573c32c------2</link>
            <guid isPermaLink="false">https://medium.com/p/921761d410ca</guid>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[sitecore-8]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[sitecore-development]]></category>
            <category><![CDATA[sitecore]]></category>
            <dc:creator><![CDATA[William Chislett]]></dc:creator>
            <pubDate>Tue, 03 Jul 2018 22:41:12 GMT</pubDate>
            <atom:updated>2018-08-10T22:01:48.409Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V0JxkArAq_Vz61Y3" /><figcaption>It’s a tenuous link.</figcaption></figure><p>I recently debugged an issue where personalization rules were checking details of the current user, but still passing/failing after that user logged out. The current Sitecore.Analyticssession was being used to check the user’s info and this persists even after logout:</p><pre>Tracker.Current.Session.Contact;</pre><p>It’s often useful to completely clear the session (HTTP and Sitecore) when debugging or testing, and I’ve seen examples of MVC or .aspx helper endpoints to trigger this, but most don’t include clearing everything. For example, create an endpoint <a href="http://my-site/kill-session"><em>http://my-site/kill-session</em></a><em> </em>and add the following:</p><pre>HttpContext.Current.Session.Abandon();<br>Sitecore.Analytics.Tracker.Current.EndVisit(true);<br>Sitecore.Analytics.Tracker.Current.EndTracking();<br>// then expire any cookies attached to HttpContext.Current.Response</pre><p>This should kill all tracking and session info.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=921761d410ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>