B4J Question Questions about sessions

dar2o3

Active Member
Licensed User
Hi all, I'm making an app you need to do things against a server created with B4J, each time the app needs such update data in the db server what I do is create a new session on the server, as if I loguin again, not because it is the time that can elapse since the last connection to the server app, if not the most correct and the B4J server (jetty) automatically cancels the previous session if it still exists or create a new.

Sorry for my English.
 

Erel

Administrator
Staff member
Licensed User
I'm sorry but I'm not sure that I correctly understand the question.

Do you want to use a new session for each request? In that case don't use sessions at all. The purpose of sessions is to store data in the server related to a "user" instead of one specific request.
 

dar2o3

Active Member
Licensed User
each time a user logs in, I keep as session variable user id, for some tasks I need to retrieve the user id stored in the session to perform some queries to bd as not if the session on the server expired or no, I think the session again, is not that correct?

thank you very much.
 

Erel

Administrator
Staff member
Licensed User
You call req.GetSession to get the session. The session will not expire unless you explicitly call invalidate or set MaxActiveInterval.
 
Top