You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "donxu99@yahoo.com" <do...@yahoo.com> on 2011/10/03 16:00:14 UTC

What is the right way to identify the second login for the same user?

Please provide your advice about what is the easiest way to identify the
second time user login for same user.   

User login in one machine and one session is created.
User go to another machine and login again. The system create a another
session for the same user and there are two sessions associated with the
user.

What is the best way to identify the second time login for this user and
kill the first session?  The application has Wicket Page and Ajax page or
link also.


Thanks in advance.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-right-way-to-identify-the-second-login-for-the-same-user-tp3867590p3867590.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: What is the right way to identify the second login for the same user?

Posted by vineet semwal <vi...@gmail.com>.
in a non wicket request ,you will have a non wicket session ..
is your this question related to previous question?

for a wicketsession there is a httpsession ,cant exist without it,when
you will invalidate the session like in previous case
both will get invalidated ..



On Mon, Oct 3, 2011 at 9:19 PM, donxu99@yahoo.com <do...@yahoo.com> wrote:
> Vineet,
>
> Thanks for the help.
>
> I also need to handle non Wicket Request.  Is the session is Wicket Session
> or HttpSession?
>
>
> Thanks
>
> Don
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-right-way-to-identify-the-second-login-for-the-same-user-tp3867590p3867889.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
>
>



-- 
thank you,

regards,
Vineet Semwal

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


Re: What is the right way to identify the second login for the same user?

Posted by "donxu99@yahoo.com" <do...@yahoo.com>.
Vineet,

Thanks for the help.

I also need to handle non Wicket Request.  Is the session is Wicket Session
or HttpSession?


Thanks

Don


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-right-way-to-identify-the-second-login-for-the-same-user-tp3867590p3867889.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: What is the right way to identify the second login for the same user?

Posted by vineet semwal <vi...@gmail.com>.
correcting a  typo i made
retrieve the  previous session by *userid*

On Mon, Oct 3, 2011 at 7:54 PM, vineet semwal
<vi...@gmail.com> wrote:
> you can store sessionid corresponding to a particular user ,
> if he tries to login from different browser,you can retrieve the
> previous session by session id
>  kill the old session when the user logs in from different browser...
>
> 1) sessionid=findsessionbyuserid()
> 2)application.sessionUnbound(sessionid)
>
> On Mon, Oct 3, 2011 at 7:30 PM, donxu99@yahoo.com <do...@yahoo.com> wrote:
>> Please provide your advice about what is the easiest way to identify the
>> second time user login for same user.
>>
>> User login in one machine and one session is created.
>> User go to another machine and login again. The system create a another
>> session for the same user and there are two sessions associated with the
>> user.
>>
>> What is the best way to identify the second time login for this user and
>> kill the first session?  The application has Wicket Page and Ajax page or
>> link also.
>>
>>
>> Thanks in advance.
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-right-way-to-identify-the-second-login-for-the-same-user-tp3867590p3867590.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
>>
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
>



-- 
thank you,

regards,
Vineet Semwal

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


Re: What is the right way to identify the second login for the same user?

Posted by vineet semwal <vi...@gmail.com>.
you can store sessionid corresponding to a particular user ,
if he tries to login from different browser,you can retrieve the
previous session by session id
 kill the old session when the user logs in from different browser...

1) sessionid=findsessionbyuserid()
2)application.sessionUnbound(sessionid)

On Mon, Oct 3, 2011 at 7:30 PM, donxu99@yahoo.com <do...@yahoo.com> wrote:
> Please provide your advice about what is the easiest way to identify the
> second time user login for same user.
>
> User login in one machine and one session is created.
> User go to another machine and login again. The system create a another
> session for the same user and there are two sessions associated with the
> user.
>
> What is the best way to identify the second time login for this user and
> kill the first session?  The application has Wicket Page and Ajax page or
> link also.
>
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-right-way-to-identify-the-second-login-for-the-same-user-tp3867590p3867590.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
>
>



-- 
thank you,

regards,
Vineet Semwal

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


Re: What is the right way to identify the second login for the same user?

Posted by Christian Huber <hu...@butterbrot.org>.
I might be wrong, but this does not seem like a Wicket related problem.

Here a spontaneous idea what I would try:

To track sessions of a user I would try to use a database table that 
associates sessions with users and a boolean flag "isvalid".
A new session would have to create an entry in that table with isvalid 
set to true and in the same transaction find all existing entries for 
the same entries to set isvalid in those records to false.
For every request a session would have to check in that table if it is 
still valid and if not invalidate itself and delete the record (probably 
best done in onBeginRequest of IRequestCycleHandler). Also when a 
session times out the corresponding record has to be deleted (probably 
best done in sessionUnbound in WebApplication).

Not sure if that is the best way, but at the moment that is the only way 
that comes to my mind. Hopefully this gives you an idea where to start.

Cheers, Chris


The Sanity Resort <http://sanityresort.blogspot.com/>

Am 03.10.2011 16:00, schrieb donxu99@yahoo.com:
> Please provide your advice about what is the easiest way to identify the
> second time user login for same user.
>
> User login in one machine and one session is created.
> User go to another machine and login again. The system create a another
> session for the same user and there are two sessions associated with the
> user.
>
> What is the best way to identify the second time login for this user and
> kill the first session?  The application has Wicket Page and Ajax page or
> link also.
>
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-right-way-to-identify-the-second-login-for-the-same-user-tp3867590p3867590.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
>