[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

I am trying to display the value of a cookie in a jsp page; however, instead of displaying the users email, I get random letters and characters.

Posted on 2009-04-28
6
Medium Priority
?
183 Views
Last Modified: 2012-05-06
I am trying to display the value of a cookie in a jsp page; however, instead of displaying the users email, I get random letters and characters.
0
Comment
Question by:AlexanderMaxwell
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 24253714
Post your code, and we should be able to help you with this.

We print cookie values to debugging pages, and it's fine.  So it works, there must be something about the way you're doing it.
0
 
LVL 28

Expert Comment

by:rrz
ID: 24253923
>I get random letters and characters.
Could that be the session id ?    
Try  
<%=cookie.getName()%>
0
 
LVL 28

Expert Comment

by:rrz
ID: 24253958
I think I mislead you in your last question. Try redirecting instead of forwarding.  
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 500 total points
ID: 24254137
Code that works:

<%
      Cookie[] cookies = request.getCookies();
      for( int i=0; i<cookies.length; i++) {
%>
<br/>cookies[<%=i%>].getName() = <%=cookies[i].getName()%>&nbsp;&nbsp;<%=cookies[i].getValue()%>
<%      }      %>
0
 

Author Comment

by:AlexanderMaxwell
ID: 24256209
that works, but along with the email I'm storing in the cookie, I'm getting something that looks like hex code. I'll try to post my code.
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 24256610
In that case, I bet rrz@871311 is right and you're seeing the session id.  That shouldn't be a problem, so you'll need to post enough of your code with an explanation of what you don't like about the results for us to help you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question