File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Accessing to Session object [urgent!] Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Accessing to Session object [urgent!]" Watch "Accessing to Session object [urgent!]" New topic
Author

Accessing to Session object [urgent!]

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi to all!
I'm trying to access to the Session Object thru javascript, just like in a jsp:
session.setAttribute(name, value);
and
session.removeAttribute(name);
With this java code you access to the active session opened with thru your navigator, but now I need to access to these attributes(cookies) thru javascript to remove them (session.removeAttribute(name)), but I don't know if it is possible...
Would anyone like to help me?
Any hint will be great!
Thanks in advance,
Nancy.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 411
You can not access session object through JavaScript.
All you could do, is use JavaScript to submit a request to a JSP or Servlet - and it wil clean a session or provide you a value.
By the way, what are you trying to do?
May be keeping objects in request instead of session will work?
 
 
subject: Accessing to Session object [urgent!]
 
Threads others viewed
Session problem in Struts and Tomcat
How to access session data from JavaScript
setAttribute(String name, Object value) question
how to clear form objects
Synchronizer Token: for the J2EE pattern book authors ...