You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ravaszroka <ra...@yahoo.com> on 2013/03/27 10:00:53 UTC

how to create a new Session

hello.

how can tell the wicket application to create and use a new session for
subsequent requests?
the problem to solve is: 
the session keeps track of userdata. on the login page a new session should
be created and used. 
one solution would be to reset the userdata when i'm on the login page.
however, if in a browser (chrome) i try to log in from 2 different tabs the
session is shared, which obviously is not what i want.

can someone lighten me on the relationship between httpsession and wicket
session. 

thanks.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to create a new Session

Posted by Paul Bors <pa...@bors.ws>.
Wait I got this, you could use some subliminal algorithm to figure out that
the new person at the keyboard is not the same one and then log them out :)

~ Thank you,
   Paul Bors

On Wed, Mar 27, 2013 at 12:31 PM, Paul Bors <pa...@bors.ws> wrote:

> Ohh, and yes. If a new tab opens while a session is still around isn't
> that normal to take over the existing session?
>
> Is like leaving home w/o locking the front door and then expecting to find
> it locked when you come back from work.
> Set the session time out to a smaller amount of time, like 1 min to solve
> that problem.
> ~ Thank you,
>    Paul Bors
> On Wed, Mar 27, 2013 at 12:28 PM, Paul Bors <pa...@bors.ws> wrote:
>
>> Not even, he already knows is a new session:
>>
>> "A new user comes and tries to log in (before the
>> session expires). He would get the same session, wouldn't he? How can I
>> enforce that he get a new session?"
>>
>> I advise you only create new sessions after the user authenticates (ie: always
>> create a new session each time you log in).
>> Any old versions such as the one left behind because of the closed tab,
>> let it expire and it would eventually be cleaned up.
>>
>> ~ Thank you,
>>    Paul Bors
>>
>> On Wed, Mar 27, 2013 at 11:36 AM, Martin Grigorov <mg...@apache.org>wrote:
>>
>>> On Wed, Mar 27, 2013 at 5:34 PM, Hans Lesmeister 2 <
>>> hans.lesmeister@lessy-software.de> wrote:
>>>
>>> > you might be looking for Session.replaceSession()
>>> >
>>>
>>> plus WebRTC and face recognition
>>>
>>> you need to find out somehow that another person is using the session of
>>> the first person
>>>
>>>
>>>
>>> >
>>> >
>>> >
>>> > -----
>>> > --
>>> > Regards,
>>> > Hans
>>> >
>>> > http://cantaa.de
>>> >
>>> > --
>>> > View this message in context:
>>> >
>>> http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553p4657574.html
>>> > Sent from the Users forum mailing list archive at Nabble.com.
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> > For additional commands, e-mail: users-help@wicket.apache.org
>>> >
>>> >
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com <http://jweekend.com/>
>>>
>>
>>
>

Re: how to create a new Session

Posted by Paul Bors <pa...@bors.ws>.
Ohh, and yes. If a new tab opens while a session is still around isn't that
normal to take over the existing session?

Is like leaving home w/o locking the front door and then expecting to find
it locked when you come back from work.
Set the session time out to a smaller amount of time, like 1 min to solve
that problem.
~ Thank you,
   Paul Bors
On Wed, Mar 27, 2013 at 12:28 PM, Paul Bors <pa...@bors.ws> wrote:

> Not even, he already knows is a new session:
>
> "A new user comes and tries to log in (before the
> session expires). He would get the same session, wouldn't he? How can I
> enforce that he get a new session?"
>
> I advise you only create new sessions after the user authenticates (ie: always
> create a new session each time you log in).
> Any old versions such as the one left behind because of the closed tab,
> let it expire and it would eventually be cleaned up.
>
> ~ Thank you,
>    Paul Bors
>
> On Wed, Mar 27, 2013 at 11:36 AM, Martin Grigorov <mg...@apache.org>wrote:
>
>> On Wed, Mar 27, 2013 at 5:34 PM, Hans Lesmeister 2 <
>> hans.lesmeister@lessy-software.de> wrote:
>>
>> > you might be looking for Session.replaceSession()
>> >
>>
>> plus WebRTC and face recognition
>>
>> you need to find out somehow that another person is using the session of
>> the first person
>>
>>
>>
>> >
>> >
>> >
>> > -----
>> > --
>> > Regards,
>> > Hans
>> >
>> > http://cantaa.de
>> >
>> > --
>> > View this message in context:
>> >
>> http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553p4657574.html
>> > Sent from the Users forum mailing list archive at Nabble.com.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com <http://jweekend.com/>
>>
>
>

Re: how to create a new Session

Posted by Paul Bors <pa...@bors.ws>.
Not even, he already knows is a new session:

"A new user comes and tries to log in (before the
session expires). He would get the same session, wouldn't he? How can I
enforce that he get a new session?"

I advise you only create new sessions after the user authenticates (ie: always
create a new session each time you log in).
Any old versions such as the one left behind because of the closed tab, let
it expire and it would eventually be cleaned up.

~ Thank you,
   Paul Bors

On Wed, Mar 27, 2013 at 11:36 AM, Martin Grigorov <mg...@apache.org>wrote:

> On Wed, Mar 27, 2013 at 5:34 PM, Hans Lesmeister 2 <
> hans.lesmeister@lessy-software.de> wrote:
>
> > you might be looking for Session.replaceSession()
> >
>
> plus WebRTC and face recognition
>
> you need to find out somehow that another person is using the session of
> the first person
>
>
>
> >
> >
> >
> > -----
> > --
> > Regards,
> > Hans
> >
> > http://cantaa.de
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553p4657574.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: how to create a new Session

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Mar 27, 2013 at 5:34 PM, Hans Lesmeister 2 <
hans.lesmeister@lessy-software.de> wrote:

> you might be looking for Session.replaceSession()
>

plus WebRTC and face recognition

you need to find out somehow that another person is using the session of
the first person



>
>
>
> -----
> --
> Regards,
> Hans
>
> http://cantaa.de
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553p4657574.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: how to create a new Session

Posted by Hans Lesmeister 2 <ha...@lessy-software.de>.
you might be looking for Session.replaceSession()



-----
-- 
Regards, 
Hans 

http://cantaa.de 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553p4657574.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to create a new Session

Posted by ravaszroka <ra...@yahoo.com>.
Thanks for the answer. I have however a follow up question.

In a browser there are at least two tabs open. In one of them a user logs in
and instead of logging out (where the session is explicitely invalidated) he
just closes the tab. A new user comes and tries to log in (before the
session expires). He would get the same session, wouldn't he? How can I
enforce that he get a new session?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553p4657556.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to create a new Session

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Wed, Mar 27, 2013 at 11:00 AM, ravaszroka <ra...@yahoo.com> wrote:

> hello.
>
> how can tell the wicket application to create and use a new session for
> subsequent requests?
> the problem to solve is:
> the session keeps track of userdata. on the login page a new session should
> be created and used.
>

getSession().bind(); is what you need


> one solution would be to reset the userdata when i'm on the login page.
> however, if in a browser (chrome) i try to log in from 2 different tabs the
> session is shared, which obviously is not what i want.
>
>
the session is shared between the tabs.
session scope means - all requests from an user agent until the session is
invalidated or expire due to inactivity


> can someone lighten me on the relationship between httpsession and wicket
> session.
>

Wicket's Session is stored as an attribute in the HttpSession


>
> thanks.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/how-to-create-a-new-Session-tp4657553.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: how to create a new Session

Posted by Bernard <bh...@gmail.com>.
Hi,

Do you want to get rid of an existing session?

Bernard


On Wed, 27 Mar 2013 02:00:53 -0700 (PDT), you wrote:

>hello.
>
>how can tell the wicket application to create and use a new session for
>subsequent requests?
>the problem to solve is: 
>the session keeps track of userdata. on the login page a new session should
>be created and used. 
>one solution would be to reset the userdata when i'm on the login page.
>however, if in a browser (chrome) i try to log in from 2 different tabs the
>session is shared, which obviously is not what i want.
>
>can someone lighten me on the relationship between httpsession and wicket
>session. 
>
>thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org