Hi,I am trying to learn Play! Framework with developing an complete application which will serve on GAE.I am reading the document of Play! Framework since it is one good source. It is quite well written, thanks.However, you can suggest me additional sources to learn Play! Framework better, please.After this introduction, I have a couple of questions about application state. I have managed to figure out with my experience from other frameworks but Play! Framework has stateless architecture.
- After user login, I am allowed to store only one string attribute of user object in session. How can I manage keep user object itself in session ? Should I get object from persistence layer with its Id in session before every request ? Is that good practice ?
- Maybe you should explain how to develop shopping cart application with Stateless Play! Framework. That example clarifies the point.
- Related to session question, after users make login to application, how can I know count of users currently logged in the application ?
I want to reach the information of sessions currently run in my application and the user information stored in their sessions.
Could you please give an example of building that on stateless Play! Framework?
I think answers of this questions would help lots of people in community.Thanks in advance,Ozan.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
On Mon, Jan 10, 2011 at 12:28, Ali Ozan ?il <java...@gmail.com> wrote:
> Related to session question, after users make login to application, how can
> I know count of users currently logged in the application ?
> I want to reach the information of sessions currently run in my application
> and the user information stored in their sessions.
I think the first question you should ask if why you need this
information. When you have server-side sessions it's important to
monitor the number of logged-in users and how much information you're
storing because you could run out of memory if too many users are
logged in simultaneously.
In a stateless application, you don't have this problem. And actually
with a stateless application there is no concept of "logged in users"
from a server point of view. Think carefully about what you want to
measure, and why. Do you need to measure usage? Is it number of
request / seconds? Number of logged in request / seconds?
--
Erwan Loisant
On Monday, January 10, 2011 10:53:31 AM UTC-5, elondo wrote:
...
how about having a "lastActivityTime" timestamp column in your user
table. You can assume the user is no longer active if s/he has not
been active for X number of seconds. So you can do a "select count(u)
from User u where u.lastActivityTime > ?" and pass crrent date - X
seconds?
--
Play encrypts the session data to prevent access to it from the browser-side.
--