You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Claudiu ANGHEL <cl...@skynet.be> on 2002/04/13 11:19:02 UTC

Re: Session Problem

Possible hint:
Seems to be a problem related to sessions :) Do you have the cookies enabled
in your browser? If not the session management will be done via encodeURL()

Which version of  Tomcat do you use?
Somewhere in
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4-b2/RELEAS
E-NOTES :
----------------------
Bugzilla Bugs Resolved:
----------------------

    6846  dispatcher.forward() is confused when using special servlet
mapping URLs
    6982  Stop + start of the context makes weird things
    7061  Servlet loaded TWICE on application startup?
**7102  response.encodeURL() doesn't encode**
    7171  FileStore directory must exists
    7344  Tomcat appears to be case-sensitive with regard to the token
"Basic"
      in Authorization request parameter


----- Original Message -----
From: "Leonid_Srl1" <le...@srl.co.il>
To: <st...@jakarta.apache.org>
Sent: Saturday, April 13, 2002 11:55 AM
Subject: Session Problem


Hi,

I used usual way to save logged user parameters:


In LogonAction class :
 session.setAttribute(Constants.USER_KEY, user);

where user is class.

In jsp file :

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<table width=700 cellpadding="0" cellspacing="0" border="0">
<B>Hello <bean:write name="user" property="fullName" filter="true"/>
  Company: <bean:write name="user" property="companyName"
filter="true"/></B>

And here I got strange behaviour : old logged user is getting Hello recently
logged user with all
appropriate security.

There is a little similar case in
http://w6.metronet.com/~wjm/tomcat/2000/Jul/msg00316.html

Leonid.







--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Session Problem

Posted by Leonid_Srl1 <le...@srl.co.il>.
I understand now that session is ok :
I always get right NameFromSess :  out.println(NameFromSess: <%=
session.getAttribute("fullName")%> );

So something wrong in my User class,  here I get different userName:
com.srl.support.User user = (com.srl.support.User)
session.getAttribute("user");
out.println("from session user : "+ user.get("firstName"));

I put the User insatnce in LogonAction in usual way:
session.setAttribute(Constants.USER_KEY, user);

What might be wrong?


> > I have cookies enabled. I use tomcat 4.0.3.
> >
> > > Possible hint:
> > > Seems to be a problem related to sessions :) Do you have the cookies
> > enabled
> > > in your browser? If not the session management will be done via
> > encodeURL()
> > >
> > > Which version of  Tomcat do you use?
> > > Somewhere in
> > >
> >
>
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4-b2/RELEAS
> > > E-NOTES :
> > > ----------------------
> > > Bugzilla Bugs Resolved:
> > > ----------------------
> > >
> > >     6846  dispatcher.forward() is confused when using special servlet
> > > mapping URLs
> > >     6982  Stop + start of the context makes weird things
> > >     7061  Servlet loaded TWICE on application startup?
> > > **7102  response.encodeURL() doesn't encode**
> > >     7171  FileStore directory must exists
> > >     7344  Tomcat appears to be case-sensitive with regard to the token
> > > "Basic"
> > >       in Authorization request parameter
> > >
> > >
> > > ----- Original Message -----
> > > From: "Leonid_Srl1" <le...@srl.co.il>
> > > To: <st...@jakarta.apache.org>
> > > Sent: Saturday, April 13, 2002 11:55 AM
> > > Subject: Session Problem
> > >
> > >
> > > Hi,
> > >
> > > I used usual way to save logged user parameters:
> > >
> > >
> > > In LogonAction class :
> > >  session.setAttribute(Constants.USER_KEY, user);
> > >
> > > where user is class.
> > >
> > > In jsp file :
> > >
> > > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > >
> > > <table width=700 cellpadding="0" cellspacing="0" border="0">
> > > <B>Hello <bean:write name="user" property="fullName" filter="true"/>
> > >   Company: <bean:write name="user" property="companyName"
> > > filter="true"/></B>
> > >
> > > And here I got strange behaviour : old logged user is getting Hello
> > recently
> > > logged user with all
> > > appropriate security.
> > >
> > > There is a little similar case in
> > > http://w6.metronet.com/~wjm/tomcat/2000/Jul/msg00316.html
> > >
> > > Leonid.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Session Problem

Posted by Claudiu ANGHEL <cl...@skynet.be>.
A method used by me sometimes for debugging the session problems:
Change in the IE(6.0) in Tools->Internet options->Privacy->Advanced
Select prompt for cookies.
Now restart the IE (close all IE and then start IE again) and check the
values of session cookies (JSESSIONID) when you are going to different
pages.
This way you can isolate the problem: you can find if a new session is
generated when you are going to a new page or is something wrong with
storing the variables in the session.

----- Original Message -----
From: "Leonid_Srl1" <le...@srl.co.il>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Saturday, April 13, 2002 12:28 PM
Subject: Re: Session Problem


> I have cookies enabled. I use tomcat 4.0.3.
>
>
> ----- Original Message -----
> From: "Claudiu ANGHEL" <cl...@skynet.be>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Saturday, April 13, 2002 11:19 AM
> Subject: Re: Session Problem
>
>
> > Possible hint:
> > Seems to be a problem related to sessions :) Do you have the cookies
> enabled
> > in your browser? If not the session management will be done via
> encodeURL()
> >
> > Which version of  Tomcat do you use?
> > Somewhere in
> >
>
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4-b2/RELEAS
> > E-NOTES :
> > ----------------------
> > Bugzilla Bugs Resolved:
> > ----------------------
> >
> >     6846  dispatcher.forward() is confused when using special servlet
> > mapping URLs
> >     6982  Stop + start of the context makes weird things
> >     7061  Servlet loaded TWICE on application startup?
> > **7102  response.encodeURL() doesn't encode**
> >     7171  FileStore directory must exists
> >     7344  Tomcat appears to be case-sensitive with regard to the token
> > "Basic"
> >       in Authorization request parameter
> >
> >
> > ----- Original Message -----
> > From: "Leonid_Srl1" <le...@srl.co.il>
> > To: <st...@jakarta.apache.org>
> > Sent: Saturday, April 13, 2002 11:55 AM
> > Subject: Session Problem
> >
> >
> > Hi,
> >
> > I used usual way to save logged user parameters:
> >
> >
> > In LogonAction class :
> >  session.setAttribute(Constants.USER_KEY, user);
> >
> > where user is class.
> >
> > In jsp file :
> >
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> >
> > <table width=700 cellpadding="0" cellspacing="0" border="0">
> > <B>Hello <bean:write name="user" property="fullName" filter="true"/>
> >   Company: <bean:write name="user" property="companyName"
> > filter="true"/></B>
> >
> > And here I got strange behaviour : old logged user is getting Hello
> recently
> > logged user with all
> > appropriate security.
> >
> > There is a little similar case in
> > http://w6.metronet.com/~wjm/tomcat/2000/Jul/msg00316.html
> >
> > Leonid.
> >
> >
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Session Problem

Posted by Leonid_Srl1 <le...@srl.co.il>.
I have cookies enabled. I use tomcat 4.0.3.


----- Original Message -----
From: "Claudiu ANGHEL" <cl...@skynet.be>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Saturday, April 13, 2002 11:19 AM
Subject: Re: Session Problem


> Possible hint:
> Seems to be a problem related to sessions :) Do you have the cookies
enabled
> in your browser? If not the session management will be done via
encodeURL()
>
> Which version of  Tomcat do you use?
> Somewhere in
>
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4-b2/RELEAS
> E-NOTES :
> ----------------------
> Bugzilla Bugs Resolved:
> ----------------------
>
>     6846  dispatcher.forward() is confused when using special servlet
> mapping URLs
>     6982  Stop + start of the context makes weird things
>     7061  Servlet loaded TWICE on application startup?
> **7102  response.encodeURL() doesn't encode**
>     7171  FileStore directory must exists
>     7344  Tomcat appears to be case-sensitive with regard to the token
> "Basic"
>       in Authorization request parameter
>
>
> ----- Original Message -----
> From: "Leonid_Srl1" <le...@srl.co.il>
> To: <st...@jakarta.apache.org>
> Sent: Saturday, April 13, 2002 11:55 AM
> Subject: Session Problem
>
>
> Hi,
>
> I used usual way to save logged user parameters:
>
>
> In LogonAction class :
>  session.setAttribute(Constants.USER_KEY, user);
>
> where user is class.
>
> In jsp file :
>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> <table width=700 cellpadding="0" cellspacing="0" border="0">
> <B>Hello <bean:write name="user" property="fullName" filter="true"/>
>   Company: <bean:write name="user" property="companyName"
> filter="true"/></B>
>
> And here I got strange behaviour : old logged user is getting Hello
recently
> logged user with all
> appropriate security.
>
> There is a little similar case in
> http://w6.metronet.com/~wjm/tomcat/2000/Jul/msg00316.html
>
> Leonid.
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>