TheBlack
TheBlack

Reputation: 53

Session-based authentication security

As far as I know, after the authentication phase, when the user has sent his username and password to the server, using basic authentication over or without https, the server send a sessionId to the client, and after that client use this sessionId for each subsequent request.

best ragards.

Upvotes: 0

Views: 189

Answers (2)

Dan Rosenqvist
Dan Rosenqvist

Reputation: 91

You can set the httpOnly flag to assure that the cookie cannot be read from javascript.

The secure flag can assure that the cookie can only be transported over an SSL/TLS based connection.

Upvotes: 1

symcbean
symcbean

Reputation: 48387

is sent as cookie and can be easily eavesdropped.

Not if it was sent via HTTPS (you have added this as a tag). Which is rather the point of HTTPS.

There are other attacks which can compromise a web session but that's a different and longer discussion.

My second question

Should have been posted as a separate question.

A session id is specifically bound to the session and can therefore reference state information beyond that required for authentication (e.g. your shopping basket) while token authentication exclusively deals with authentication.

Upvotes: 0

Related Questions