Well, i know that the title is not saying much, i am sure that many people is asking that question (I didn't find any).
I am building a new web site with user interface, and when the user login into the web i am giving him a guid into session,
Something like that - Session["User"] = Guid.NewGuid();
So. I am using this User(Session) as my main token into the web, is my way of checking who is he, is he logged in? and hes token to the whole web api.
The question is really simple. How safe is this? because you can get this via simple JavaScript right? but i am not sure if they have any way of getting this (Talking about hackers not the user). and another question, can the user get this?
SO. to make it more simple because my english is probably really bad.
- How safe is this?
- Can the user get this ?
Thanks alot guys, have a good night.
EDIT --
This is the JavaScript to get the session for thos who ask how to do it
<script type="text/javascript">
GetUserName();
function GetUserName()
{
var username = '<%= Session["User"] %>';
alert(username );
}
</script>