Re: [jetty-user] Create a session from an existing one

Silvio Bierman <[email protected]> Thu, 19 Jun 2014 23:33:04 +0200
Newsgroups gmane.comp.java.jetty.support
Message-ID <[email protected]>
--------------050602090402080402030309
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Joakim,

No, I want a new session on its own which I will adress by (re)directing 
windows to them via URLs with session ids in them. I don't want to 
invalidate the current session because I need both.

Cheers,

Silvio


On 06/19/2014 05:44 PM, Joakim Erdfelt wrote:
> 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] <mailto:[email protected]>>
> webtide.com <http://www.webtide.com/> - intalio.com/jetty 
> <http://intalio.com/jetty>
> Expert advice, services and support from from the Jetty & CometD experts
> eclipse.org/jetty <http://eclipse.org/jetty/> - cometd.org 
> <http://cometd.org/>
>
>
> On Thu, Jun 19, 2014 at 1:05 AM, Silvio Bierman 
> <[email protected] <mailto:[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
>
>
>


--------------050602090402080402030309
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Joakim,<br>
      <br>
      No, I want a new session on its own which I will adress by
      (re)directing windows to them via URLs with session ids in them. I
      don't want to invalidate the current session because I need both.<br>
      <br>
      Cheers,<br>
      <br>
      Silvio<br>
      <br>
      <br>
      On 06/19/2014 05:44 PM, Joakim Erdfelt wrote:<br>
    </div>
    <blockquote
cite="mid:CAG4zZZB7W7RR3k8ExY2hf2ypMDVsnitUXqc_UghAP3CBTtkM2Q@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="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?</div>
        <div>If so, why not invalidate the current one, and make a new
          one via the servlet api?</div>
        <div><br>
        </div>
        <div>   Session currentSess = req.getSession();</div>
        <div>   if ( currentSess != null ) {</div>
        <div>      currentSess.invalidate();</div>
        <div>   }</div>
        <div>   Session newSess = req.getSession(true);</div>
        <div>
          <br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div>
          <div dir="ltr">
            <div>--</div>
            <div>Joakim Erdfelt &lt;<a moz-do-not-send="true"
                href="mailto:[email protected]" target="_blank">[email protected]</a>&gt;</div>
            <div><a moz-do-not-send="true"
                href="http://www.webtide.com/" target="_blank">webtide.com</a> -
              <a moz-do-not-send="true" href="http://intalio.com/jetty"
                target="_blank">intalio.com/jetty</a></div>
            <div><span>Expert advice, services and support from </span><span>from
                the Jetty &amp; CometD experts</span></div>
            <div><a moz-do-not-send="true"
                href="http://eclipse.org/jetty/" target="_blank">eclipse.org/jetty</a> - <a
                moz-do-not-send="true" href="http://cometd.org/"
                target="_blank">cometd.org</a></div>
          </div>
        </div>
        <br>
        <br>
        <div class="gmail_quote">On Thu, Jun 19, 2014 at 1:05 AM, Silvio
          Bierman <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:[email protected]" target="_blank">[email protected]</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote">
            Hello all,<br>
            <br>
            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.<br>
            <br>
            I am using URL based session tracking and need to provide a
            URL that will land 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>
            ---------------------------------------------------------------------<br>
            To unsubscribe from this list, please visit:<br>
            <br>
               <a moz-do-not-send="true"
              href="http://xircles.codehaus.org/manage_email"
              target="_blank">http://xircles.codehaus.org/manage_email</a><br>
            <br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------050602090402080402030309--