?
Solved

Session problem for browser Opera

Posted on 2004-09-30
3
Medium Priority
?
848 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 200 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

771 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