You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Armaz Mellati <ar...@uninett.no> on 2006/01/30 15:17:52 UTC

How to make sessions survive browser restart

Hi


This may not be a Cocoon issue, however I take the chance.

I am using Cocoon-portal behind Tomcat, and I can't figure out what to do to make Cocoon recognize users already logged inn after
they have restarted their browsers. 
I know that in a cookie, you can set the maxAge with setMaxAge(). But how can I do that for the JSESSIONID cookie ??? Where is that
cookie made ? 

Thanks for any tip in advance.

Regards,
Armaz Mellati 


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


Re: How to make sessions survive browser restart

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 31 janv. 06, à 13:50, Armaz Mellati a écrit :

> ...Stop asking stupid questions :)

As I always tell my students: the only stupid questions are the ones 
you don't dare to ask ;-)

-Bertrand

RE: How to make sessions survive browser restart

Posted by Armaz Mellati <ar...@uninett.no>.
Dear Armaz

All you needed to do was :

Cookie [] cookies = request.getCookies();
for (int i=0;i<cookies.length;i++){
	if (cookies[i].getName().equals("JSESSIONID")){
		cookies[i].setMaxAge(6*3600); // expire after 6 houre
		cookies[i].setValue(request.getSession().getId());
		response.addCookie(cookies[i]);
		break;
	}
}


Stop asking stupid questions :)

Regards,
Armaz 

> -----Original Message-----
> From: Armaz Mellati [mailto:armaz.mellati@uninett.no] 
> Sent: 30. januar 2006 15:18
> To: users@cocoon.apache.org
> Subject: How to make sessions survive browser restart
> 
> Hi
> 
> 
> This may not be a Cocoon issue, however I take the chance.
> 
> I am using Cocoon-portal behind Tomcat, and I can't figure 
> out what to do to make Cocoon recognize users already logged 
> inn after they have restarted their browsers. 
> I know that in a cookie, you can set the maxAge with 
> setMaxAge(). But how can I do that for the JSESSIONID cookie 
> ??? Where is that cookie made ? 
> 
> Thanks for any tip in advance.
> 
> Regards,
> Armaz Mellati 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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