Re: [jetty-user] Create a session from an existing one
Joakim Erdfelt <[email protected]> Thu, 19 Jun 2014 08:44:33 -0700
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <CAG4zZZB7W7RR3k8ExY2hf2ypMDVsnitUXqc_UghAP3CBTtkM2Q@mail.gmail.com> |
--001a11395488da5d2904fc324031
Content-Type: text/plain; charset=UTF-8
I don't understand what you are attempting to do?
Are you wanting a new Session object based on a request?
If so, why not invalidate the current one, and make a new one via the
servlet api?
Session currentSess = req.getSession();
if ( currentSess != null ) {
currentSess.invalidate();
}
Session newSess = req.getSession(true);
--
Joakim Erdfelt <[email protected]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org
On Thu, Jun 19, 2014 at 1:05 AM, Silvio Bierman <[email protected]
> wrote:
> Hello all,
>
> I know the servlet API does not allow this but I would like to know if
> Jetty (embedded) somehow allows creating a new session (obtaining its
> Session object) when I already have a session attached to the current
> request.
>
> I am using URL based session tracking and need to provide a URL that will
> land in the new session.
>
> Is there a way to work with the session manager or so to achieve this?
>
> Currently on Jetty 9.2.1.v20140609 using it in embedded mode.
>
> Thanks,
>
> Silvio
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--001a11395488da5d2904fc324031
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I don't understand what you are attempting to do?<div>=
<br></div><div>Are you wanting a new Session object based on a request?</di=
v><div>If so, why not invalidate the current one, and make a new one via th=
e servlet api?</div>
<div><br></div><div>=C2=A0 =C2=A0Session currentSess =3D req.getSession();<=
/div><div>=C2=A0 =C2=A0if ( currentSess !=3D null ) {</div><div>=C2=A0 =C2=
=A0 =C2=A0 currentSess.invalidate();</div><div>=C2=A0 =C2=A0}</div><div>=C2=
=A0 =C2=A0Session newSess =3D req.getSession(true);</div><div>
<br></div><div><br></div></div><div class=3D"gmail_extra"><br clear=3D"all"=
><div><div dir=3D"ltr"><div>--</div><div>Joakim Erdfelt <<a href=3D"mail=
to:[email protected]" target=3D"_blank">[email protected]</a>></div><d=
iv><a href=3D"http://www.webtide.com/" target=3D"_blank">webtide.com</a>=C2=
=A0- <a href=3D"http://intalio.com/jetty" target=3D"_blank">intalio.com/jet=
ty</a></div>
<div><span>Expert advice, services and support from=C2=A0</span><span>from =
the Jetty & CometD experts</span></div><div><a href=3D"http://eclipse.o=
rg/jetty/" target=3D"_blank">eclipse.org/jetty</a>=C2=A0-=C2=A0<a href=3D"h=
ttp://cometd.org/" target=3D"_blank">cometd.org</a></div>
</div></div>
<br><br><div class=3D"gmail_quote">On Thu, Jun 19, 2014 at 1:05 AM, Silvio =
Bierman <span dir=3D"ltr"><<a href=3D"mailto:[email protected]=
" target=3D"_blank">[email protected]</a>></span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex">
Hello all,<br>
<br>
I know the servlet API does not allow this but I would like to know if Jett=
y (embedded) somehow allows creating a new session (obtaining its Session o=
bject) when I already have a session attached to the current request.<br>
<br>
I am using URL based session tracking and need to provide a URL that will l=
and in the new session.<br>
<br>
Is there a way to work with the session manager or so to achieve this?<br>
<br>
Currently on Jetty 9.2.1.v20140609 using it in embedded mode.<br>
<br>
Thanks,<br>
<br>
Silvio<br>
<br>
<br>
------------------------------<u></u>------------------------------<u></u>-=
--------<br>
To unsubscribe from this list, please visit:<br>
<br>
=C2=A0 =C2=A0<a href=3D"http://xircles.codehaus.org/manage_email" target=3D=
"_blank">http://xircles.codehaus.org/<u></u>manage_email</a><br>
<br>
<br>
</blockquote></div><br></div>
--001a11395488da5d2904fc324031--