What you could do is check it via AJAX call on page load and render link upon getting response. When logged in sitecake should return json object {status:0} when calling sitecake//src/app.php?service=_session&action=alive. Otherwise you would get 401 Unauthorized error. Below is example using jQuery:
<script type="text/javascript"> $(function() { // Here we check if we are in edit mode or not. We don't need to render link if already in edit mode if ( !window.sitecakeGlobals || sitecakeGlobals.editMode !== true ) { $.ajax({ type: 'GET', url: 'sitecake/<version>/src/app.php?service=_session&action=alive', dataType: 'json', success: function(response) { if(typeof response !== 'undefined' && response.status === 0) { // render your link } }, error: function(xhr) { if(xhr.status === 401) { // You are not logged in so act accordingly } } }); } }); </script>
Downside of this approach is that you will need to change <version>
in URL on each Sitecake update. To make it easier, you could create php include so you will need to change it in only one place when you update your sitecake.