I'm new with angularjs...

I read the docs, and completed the tutorial; i also tried something else by myself, and things start to make sense to me.

Now i wonder how to make a **safe authentication system**.

The easy part: no code, i will describe operations my code execute:

> 
> I've a classic form: username, and password text input.
> 
> 
> The user fills the form, and press ENTER. 
> 
> 
> An ajax request starts, and the response is a JSON telling me
>  something like "ok i know you" or "i don't know who you are".
> 
> 
> 

**What i need now is to mantain the logged status of the visitor (or not logged) between the different views of my application.**

I read on the internet that, to achieve this objective, someone sets a variable ($scope.isLogged = true), someone else uses cookies; but javascript variables, and cookies can be easily edited using firebug, or similiar development tools.

... and finally the question:

So, **have you some suggestion to achieve a safe authentication system in an angularjs app?**