Solved

Session problem for browser Opera

Posted on 2004-09-30
3
834 Views
Last Modified: 2012-06-27
Hi all,

I have a page (page1.jsp) with codes:

session.setAttribute("session1", "test");
System.out.println("first: "+(String)session.getAttribute("session1"));
response.sendRedirect("page2.jsp");

Codes for page2.jsp:
System.out.println("second: "+(String)session.getAttribute("session1"));

When open page1.jsp on Opera 7.5, the result is:
first: test
second: null

Why is the session lost after redirect the page? Please help me to fix it. Thanks.

0
Comment
Question by:CodeLover
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 12193095
Try:

session.setAttribute("session1", "test");
System.out.println("first: "+(String)session.getAttribute("session1"));
response.sendRedirect( response.encodeRedirectURL( "page2.jsp" ) );

in page1.jsp

Looks like Opera isn't accepting the cookie properly...(do you have cookies turned off?)
0
 

Author Comment

by:CodeLover
ID: 12195133
Thanks. It works when it accepts cookies.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12195493
:-)

Good luck!!

Tim
0

Featured Post

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!

Question has a verified solution.

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

Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
Read the original post on Monitis Blog. Believe it or not, the most important thing about the website of your business is not what’s on it but how fast it loads. Yes, that’s right!    As you can see on this infographic (an oldie but goodie!), …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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