Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does stateless mode affect security in the Play! framework?

Stateless operation mode in the Play! framework is said to be less secure than stateful mode. How does it affect Play framework in general and is it possible to improve the security drawbacks for critical public web applications?

like image 387
Kynao Avatar asked Jul 30 '26 09:07

Kynao


1 Answers

First of all, you say that stateless is less secure? Do you have any specific reason why you believe this is the case?

The idea of a stateless model, is that you do not store data in a session needlessly, server side, which results in you having to continue the 'session chat' on that same server for the duration of the session.

If you want to mimic a J2EE Session, then you can simply use the session.id and store all state in a database, and delete at the end of the session.

The session cookie itself is signed, so it cannot be tampered with, so there is no concern that someone can hijack the session id, but if you are particularly worried, then you can simply store your own identifier in the session cookie, and encrypt it with the Crypto utility class that uses the application's secret key to encrpyt/decrypt data.

Stateless is just a change of mindset, and as long as you do not store data needlessly in the session (which is probably where you are coming from), then you should have very little to worry about.

like image 136
Codemwnci Avatar answered Jul 31 '26 22:07

Codemwnci



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!