answersLogoWhite

0


Best Answer

Using the remove Attribute tag will just remove the stated attributes from the session. Using session invalidate will terminate the entire session.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between removeAttribute and invalidate in Session?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does servlet session API means?

The Servlet Session API refers to the documentation on the list of methods available in the HttpSession class that is used for Session ManagementThe HttpSession object is very powerful and has many features. Before we dig deep into the world of Sessions, let us take a look at the important methods they have so that we can use them effectively.• getAttribute(java.lang.String name) - Returns an Object associated with that name that was stored in the session object.• getAttributeNames() - Returns an Enumeration object that lists the names of the objects stored in the session object.• getCreationTime() - Returns a long containing the date stamp of creation.• getId() - Returns the id of the session as a String representing the unique identifier assigned to this session.• getLastAccessedTime() - Returns a long containing the date stamp of the last time the session was accessed.• getMaxInactiveInterval() - Returns an integer representing the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.• invalidate() - This destroys a session. It can't be referenced after this method has been called.• isNew() - This tells you whether the client knows about the session. In other words, the has session been created by the server, but the client hasn't acknowledged receiving the session ID yet.• removeAttribute(java.lang.String name) - This removes an attribute. It deletes it from the session object.• setAttribute(java.lang.String name, java.lang.Object value) - You use this method to add objects to a session.• setMaxInactiveInterval(int interval) - Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.• getValue(java.lang.String name) - Returns an Object associated with that name that was stored in the session object. As of Version 2.2, this method is replaced by getAttribute(). The getAttribute() method will be on the exam, not this one, but it is here for completeness.• getValueNames() - Returns a String array with a list of names associated with the objects added to a given session. As of Version 2.2, this method is replaced by getAttributeNames(). The getAttributeNames() method will be on the exam, not this one, but it is here for completeness.• putValue(java.lang.String name, java.lang.Object value) - You use this method to add objects to a session. This has been deprecated. As of Version 2.2, this method is replaced by setAttribute(java.lang.String, java.lang.Object). The setAttribute() method will be on the exam, not this one, but it is here for completeness.• removeValue(java.lang.String name) - This removes a value, but retains an attribute name in the session. The name is valid but the object is null. This has been deprecated. As of Version 2.2, this method is replaced by removeAttribute(). The removeAttribute() method will be on the exam, not this one, but it is here for completeness.


WHAT is the difference between session and cookie in php?

The session is stored on the web server. The cookies is stored in a little file on users machine. This means that the session is (relatively) secure, whereas the cookie can be edited by the end user.


What is the difference between session key and master key?

A session key is a temporary encryption keyused between two principals.A master key is a long-lasting key that isused between a key distribution centre and aprincipal for the purpose of encoding thetransmission of session keys.Typically, the master keys are distributed bynoncryptographic means.


What is the difference between a session key and a master key?

A session key is a temporary encryption key used between two principals. A master key is a long-lasting key that is used between a key distribution centre and a principal for the purpose of encoding the transmission of session keys. Typically, the master keys are distributed by noncryptographic means.


What is the difference between a select committee and a standing committee?

the permanent committees that continue their work from session to session are called standing committee. and a select committee are created to do a special job for a limited time


What is the difference between standing committee and a select committee?

the permanent committees that continue their work from session to session are called standing committee. and a select committee are created to do a special job for a limited time


What is the difference between a standing committee select committee?

the permanent committees that continue their work from session to session are called standing committee. and a select committee are created to do a special job for a limited time


What is difference between Stand by and hibernate mode in Windows?

Stand by in windows is where the computer is still turned on and will resume when you want it to. Hibernate is where it saves your session (keeps what you are doing, yes everything) and then turns off the computer. When it is turned back on your session will be restored.


When does the budget session meet?

Budget session fall between feb to may each year.


What is the Difference between session and viewstate in asp?

1) Viewstate is particular to a control/page whereas session is for the whole application. You can access the session data stored in page A in page B but viewstate does not behave so. 2) ViewState is maintained at client side whereas session is maintained at server side 3) Since viewstate is maintained at client, it does not have a concept of expiry but session will expire after the stipulated time 4) You can enable/disable view state for specific controls but you can't do that for session. abhishek patel, mobile number:9558551202


What is the difference between a term of congress and a session of congress?

A term is the length of time an individual Congressman serves each election (two years in the House, six years in Senate). A session is the length of time the entire House or Senate legislates and conducts business. Except for special sessions rarely called, there is one session per year in both chambers.


What is difference between ssl session and ssl connection?

A ssl connection is a transport services that provides a acceptable type of service and A type is created by the Protocol, and it defines a set of cryptographic security parameters which can be shared among multiple connections.