<?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 Caslino on Medium]]></title>
        <description><![CDATA[Stories by Caslino on Medium]]></description>
        <link>https://medium.com/@caslino?source=rss-e64290adcfbb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KlWomWmuZIHmQjeCAZFGFw.jpeg</url>
            <title>Stories by Caslino on Medium</title>
            <link>https://medium.com/@caslino?source=rss-e64290adcfbb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:45:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@caslino/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[Using MySQL as session provider in Beego]]></title>
            <link>https://caslino.medium.com/using-mysql-as-session-provider-in-beego-ef36fdd20e5d?source=rss-e64290adcfbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef36fdd20e5d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[beego]]></category>
            <dc:creator><![CDATA[Caslino]]></dc:creator>
            <pubDate>Thu, 22 Jun 2017 12:05:59 GMT</pubDate>
            <atom:updated>2017-06-22T12:05:59.464Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*TydDd1stgtHQIRPCm1nqiQ.png" /><figcaption>Copyright Beego.me</figcaption></figure><p>Beego is a MVC framework for the Go programming language. For someone like me who hates writing boilerplate code, Beego is a life saver.</p><h3>The Issue</h3><p>This post is specifically about using MySQL as the session storage instead of the default memory option. The reason you should upgrade to using MySQL as the session provider is because the memory option fails if your application is reset or if the garbage collector clears your session memory.</p><p>The reason I am inclined to write this post is because the official documentation is outdated and I wasted months trying to figure out what the issue was while using MySQL as the provider. After tracing through the source I was able to find out the line of the code that was the problem.</p><h3>The Solution</h3><p>Follow these instructions and you should have your code running in no time.</p><p>Make sure the DB table is created. Run this script if it is not.</p><pre><br>CREATE TABLE `session` (<br> `session_key` char(64) NOT NULL,<br> `session_data` blob,<br> `session_expiry` int(11) unsigned NOT NULL,<br> PRIMARY KEY (`session_key`)<br> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;<br></pre><p>Then in your main.go function import the following</p><pre><br>import(<br>_ “github.com/astaxie/beego/session/mysql”<br> “github.com/astaxie/beego/session”<br>)<br></pre><p>Change your app.conf settings to enable sessions and to use MySQL as the provider.</p><pre>SessionOn = true<br>SessionProvider = mysql<br>SessionProviderConfig = username:password@tcp(127.0.0.1:3306)/dbname</pre><p><strong>Note</strong> that the documentation says to use</p><pre>SessionSavePath = username:password@tcp(127.0.0.1:3306)/dbname</pre><p>which I believe is incorrect. It has to be SessionProviderConfig.</p><p>After that, you should be able to access your session variables using the existing methods.</p><ul><li>SetSession(name string, value interface{})</li><li>GetSession(name string) interface{}</li><li>DelSession(name string)</li><li>SessionRegenerateID()</li><li>DestroySession()</li></ul><p>I hope this solution works for you. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef36fdd20e5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello, World!]]></title>
            <link>https://caslino.medium.com/hello-world-e793c72131d?source=rss-e64290adcfbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e793c72131d</guid>
            <dc:creator><![CDATA[Caslino]]></dc:creator>
            <pubDate>Sat, 18 Oct 2014 07:47:00 GMT</pubDate>
            <atom:updated>2014-10-18T07:58:31.555Z</atom:updated>
            <content:encoded><![CDATA[<p>For those of you who know programming the title of this post may seem familiar. Hello, World! is that simple yet elegant piece of code that gently and cheerfully introduces you to the world of programming . The sheer joy on my students faces when they see this message flashing on their screens and the feeling they get as if they have brought to life the inanimate and impersonal machine in front of them. I still remember my first time, drawing hello world on the screen by giving the turtle directional commands in the programming language called <a href="http://en.wikipedia.org/wiki/Logo_(programming_language)">Logo</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*qPBWk5UySO1gwGpqO_v6Vg.png" /></figure><p>This is my first post on medium (and after countless attempts at blogging) and what better way to kick it off than by saying Hello, World!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e793c72131d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>