You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Oscar Picasso <os...@yahoo.com> on 2006/05/17 21:02:41 UTC

Trouble with tracking sessions

Hi,

I have trouble creating sessions when disabling cookie support in the browser.

Here is the problem.

I have a login component which contains a form.
The form listener contains the following code:
public void login(IRequestCycle cycle)
{
...
((HubPage) getPage()).getUserState().setUser(user);
final IPage page = cycle.getPage("OnlineUsers");
throw new PageRedirectException(page);
}

On the other hand I have a Register page with a form.
Here is the register form listener:
public void register(IRequestCycle cycle)
{
...
getUserState().setUser(user);
final IPage page = cycle.getPage("OnlineUsers");
throw new PageRedirectException(page);
}

In both cases we expect a session scoped UserState object to be created.

That what's happen. I can insert a userStateExists property in the OnlineUsers page and can verify that in both cases a userState object has been created.

If the client has cookies enabled, I can also see that in both cases a cookie is created to keep track of the session.

But when disabling cookies, while the login version adds a jsessionid to all urls, the register version doesn't and the session is then lost when following a link on the OnlineUsers page.

Any idea ?

Thanks.

Oscar

		
---------------------------------
Ring'em or ping'em. Make  PC-to-phone calls as low as 1¢/min with Yahoo! Messenger with Voice.

Re: Trouble with session tracking [BUG?]

Posted by Oscar Picasso <os...@yahoo.com>.
Hi,

Contrary to what I though the behaviour difference is not related to whether the session scoped state object is set in a Component or a in Page. 

After further investigation it appears that when the page/component contains a PageLink, *all* urls inside the page/component are generated without the jsessionid.

I have not tested with other Links.

This behaviour seems weird. Should I fill a bug ?

Oscar Picasso <os...@yahoo.com> wrote: Hi,

I have trouble creating sessions when disabling cookie support in the browser.

Here is the problem.

I have a login component which contains a form.
The form listener contains the following code:
public void login(IRequestCycle cycle)
{
...
((HubPage) getPage()).getUserState().setUser(user);
final IPage page = cycle.getPage("OnlineUsers");
throw new PageRedirectException(page);
}

On the other hand I have a Register page with a form.
Here is the register form listener:
public void register(IRequestCycle cycle)
{
...
getUserState().setUser(user);
final IPage page = cycle.getPage("OnlineUsers");
throw new PageRedirectException(page);
}

In both cases we expect a session scoped UserState object to be created.

That what's happen. I can insert a userStateExists property in the OnlineUsers page and can verify that in both cases a userState object has been created.

If the client has cookies enabled, I can also see that in both cases a cookie is created to keep track of the session.

But when disabling cookies, while the login version adds a jsessionid to all urls, the register version doesn't and the session is then lost when following a link on the OnlineUsers page.

Any idea ?

Thanks.

Oscar

  
---------------------------------
Ring'em or ping'em. Make  PC-to-phone calls as low as 1�/min with Yahoo! Messenger with Voice.

		
---------------------------------
Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone.  Get Yahoo! Messenger with Voice