currentUser global is null. I can't figure out why Does anyone know why currentUser would return null? I'm logged in as an admin.. actually the only user.

I've cleared cache, logged out and back in, etc. I can't seem to get it to work.

I'm trying to set an edit link for an entry like so:

{% if currentUser %}
    &lt;a href="{{ entry.cpEditUrl }}"&gt;
        Edit
    &lt;/a&gt;
{% endif %}


And also tried this:

{% if entry.isEditable() %}
    &lt;a href="{{ entry.cpEditUrl }}"&gt;
        Edit
    &lt;/a&gt;
{% endif %}


Neither are working. Any ideas?
Per Brad's request. I am answering my own question.

I figured out that I was logging in via non-www, and accessing the site at www.

So the official answer is to choose either www or non-www. I chose to remove the www from the URL.

Here's my .htaccess for that, including allowing for fonts to be accessed cross domain, as I had issues with this as well.

&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

    # Remove www
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
&lt;/IfModule&gt;

&lt;FilesMatch "\.(eot|ttf|otf|woff|svg)"&gt;
    Header set Access-Control-Allow-Origin "*"
&lt;/FilesMatch&gt;


Note!!! Once this is done, make sure to clear your Craft cache., especially if using fonts/font-icons.