This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Disabling Cookies, created problem in web application?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Disabling Cookies, created problem in web application??" Watch "Disabling Cookies, created problem in web application??" New topic
Author

Disabling Cookies, created problem in web application??

Madhu Kaparapu
Ranch Hand

Joined: Jul 04, 2005
Posts: 35
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


Regards,
Madhu Kaparapu.
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
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

Joined: Jul 04, 2005
Posts: 35
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

Joined: Jan 10, 2002
Posts: 56554
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling Cookies, created problem in web application??
 
Similar Threads
Disabling the back button of web browser
Cookies and Url-rewriting question
question regarding maintaining session
Using default JAAS Mechanism in Websphere makes applications to access the context path of the other
Problem with SessionId