• Post Reply Bookmark Topic Watch Topic
  • New Topic

Disabling Cookies, created problem in web application??

 
Madhu Kaparapu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,

I am working on web application, I have never created any cookies or used.
when I disabled the cookies at my FireFox browser, the application always redirects to login page.
In login page I am setting SessionID to session attribute when the userid and password is correct. And when ever the user navigates through the application I am checking the sessionID for matching or not. IF not then redirects the request to login page.

If I enables the cookies at my firefox browser, then application goes fine.
Then I have viewed the cookies present in the browser, there i have found

Name:JSESSIONID
content:547A0010A6103BF1FD4B9BBA8652277F
host: localhost
path: mywebappName

If any user disables the cookies then my application will not work, suggest me how to solve this problem with sutible examples

Regards
Madhu Kumar
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, the sessions are handled only through cookies. You need to use URL rewriting if you want sessions to work when cookies are disabled. That means all of the href links, window.open()s and form actions need to be generated through response.encodeUrl() and the redirect url strings need to be generated through response.encodeRedirectUrl(). If you like scriptless jsps, I think the JSTL tag <c:url> automatically handles URL rewriting.

Note that if you use URL rewriting and the user logs in and then manually types in the URL for another page, this second page will not be aware of the session. Only page changes through rewritten URLs will keep session information.

-Yuriy
[ August 19, 2005: Message edited by: Yuriy Zilbergleyt ]
 
Madhu Kaparapu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u Yuriy,
But till now i have not used JSTL, can u explain the JSTL tag <c:url> that automatically handles URL rewriting. with an examples.

Regards
Madhu Kumar
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhu, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

thanks,
bear
Forum Bartender
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Madhu Kaparapu:
Thank u Yuriy,
But till now i have not used JSTL, can u explain the JSTL tag <c:url> that automatically handles URL rewriting. with an examples.

Regards
Madhu Kumar


You can download the specification here:
http://www.jcp.org/aboutJava/communityprocess/final/jsr052/index2.html

If you're going to use them, you'll want that PDF right on your desktop.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!