• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

session is not setting attribute for few Users

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are running a web application wherein I am setting an attribute in session on first jsp page i.e session.setAttribute("homeFlag","YES");

Now when user migrates to second page I am checking if the session value is "YES" using following code in my Action class.

String homeFlag = (String)session.getAttribute("homeFlag");
System.out.println("homeFlag==="+homeFlag);
if(!homeFlag.equals("YES")){
mapping.findForward("homePage");
}

Its working well for around 90% Users but for remaining Users homeFlag value is always NULL.
Could you please help me in resolving this issue.

Thanks in Advance!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most application servers rely on cookies for HTTPSession management. If some of your users have disabled cookies in their browsers, this may account for this problem. You may want to check with these users to see if they have disabled or restricted cookies.
 
vaibhav maddiwar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response!

Could you tell me any solution for this problem without actually going to User's machine and enabling the cookie.
Is there any way that session object created by us should not use cookie.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest you check your application server's documentation for how to turn on URL rewriting. This is another technique for session management that doesn't rely on cookies.
 
vaibhav maddiwar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Merrill,

Thanks for giving the hint.

I have updated my weblogic.xml with following

<session-descriptor>
<session-param>
<param-name>URLRewritingEnabled</param-name>
<param-value>True</param-value>
</session-param>
<session-param>
<param-name>CookiesEnabled</param-name>
<param-value>False</param-value>
</session-param>
</session-descriptor>

and seems like my application is using URL rewriting because I could see "jsessionId" got appended to my URL.

Thanks a lot!
 
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic