Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > BOOK: Professional Apache Tomcat
BOOK: Professional Apache Tomcat
This is the forum to discuss the Wrox book Professional Apache Tomcat by Chanoch Wiggers, Ben Galbraith, Vivek Chopra, Sing Li, Debashish Bhattacharjee, Amit Bakore, Romin Irani, Sandip Bhattacharya, Chad Fowler; ISBN: 9780764543722
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 7th, 2006, 03:13 PM
Registered User
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default RewriteRule / mod_jk / sessionid problem

I have a rule that states
gets rewritten to

RewriteRule ^/([A-Za-z0-9-]+)?$ /myapp/welcome.do?parameter=$1 [R]

The new URL contains "/myapp/", so is passed to the apache-tomcat due to the
following instruction:

<Location "/myapp/*">
    JkMount myapp
    Allow from all

(I'm using jakarta struts framework for the myapp application)
My problem is that the sessionid assigned to the user doesn't appear in the
apache log until the customer clicks beyond
http://www.mydomain.com/myapp/welcom...meter=any-text. Hitting the first URL
in the app sets the sessionid in a cookie on the users machine, subsequent
requests are logged with the sessionid in the apache log. I really need the
sessionid to be logged during the initial rewrite.

Is there an easy way to use a RewriteRule and mod_jk to resolve this?

I was thinking of something along the lines of:
* The rewrite rule can 'pass through' to a JkMount instruction.
* The 'any-text' parameter is passed to a servlet.
* The servlet sets the sessionid (cookie)
* The servlet forwards to
* I find http://www.mydomain.com/myapp/welcom...meter=any-text with a

I'd like to avoid using javascript redirect or similar

Thanks in advance!
Old December 13th, 2006, 12:42 PM
Registered User
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


I think i am having the same problem or similar...

Do you know any solution or something new?


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to reset the SessionID? akkad C# 2 October 24th, 2007 06:49 AM
session.sessionid same for all items sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 31st, 2006 12:40 PM
SessionID changing between postbacks - C# wlangel Visual Studio 2005 1 September 20th, 2006 11:23 AM
Problem with mod_jk, socket is not connected error kouterguine BOOK: Professional Apache Tomcat 0 October 6th, 2005 08:28 AM
How to Generate my own SESSIONID anand_asv .NET Framework 2.0 0 March 2nd, 2005 10:14 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.