Solved

Session problem for browser Opera

Posted on 2004-09-30
3
841 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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 article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

696 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