tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey V. Meledin" <...@webclub.ru>
Subject URL rewriting
Date Wed, 19 Apr 2000 06:15:33 GMT
Hi
 tomcat-users!

I need somebody's consultation about "session tracking" theme.

I use TomCat 3.1beta through Apache 1.3.12 and want to organize
session tracking in my servlets.
In case with enabled cookies there's no problems, all is working.
But when I prohibit cookies, my servlets lose early created session
and create new session ID by each request.
Where is my mistake?
Or my TomCat doesn't support URL-rewriting?

Here is my code:
=======================================================
//sessionID test
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class session extends HttpServlet
{
  public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
  {
    HttpSession sess = request.getSession(true);
    response.setContentType("text/html; charset=windows-1251");
    PrintWriter out = response.getWriter();

    out.println("<h2>Servlet</h2>");

    out.println("sessionID = " + sess.getId() + "<br>");

    out.println("<a href=\"" +
                response.encodeURL("session") +
                "\">self link</a>");
    //self-pointing link. I was testing session tracking with it.

  }//doGet
}
=======================================================

Thanks.


Alexey V. Meledin <avm@webclub.ru>
> InterForge Developers Group,  St-Petersburg, Russia
New: http://www.crossroad.ru; http://www.garoway.com
> > > > > > "InterForge to Forge Ahead" > > > > > > >

Alexey V. Meledin <avm@webclub.ru>
> InterForge Developers Group,  St-Petersburg, Russia
New: http://www.crossroad.ru; http://www.garoway.com
> > > > > > "InterForge to Forge Ahead" > > > > > > >



Mime
View raw message