473,379 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How to invalidate a session?

I am using invalidate method from the httpSesion class , but when I
press the back button in the internet navigator, the session still is
valid.
Jul 17 '05 #1
6 23155
"gargarensis" <ga*********@terra.es> wrote in message
news:40**************************@posting.google.c om...
I am using invalidate method from the httpSesion class , but when I
press the back button in the internet navigator, the session still is
valid.

HttpSession is an interface, not a class. What makes you think the session
is still valid?
Jul 17 '05 #2

"gargarensis" <ga*********@terra.es> wrote in message
news:40**************************@posting.google.c om...
I am using invalidate method from the httpSesion class , but when I
press the back button in the internet navigator, the session still is
valid.


Invalidating a session is server-side logic, the back-button is purely
client-side logic. You might set the appropriate HTTP headers when you send
pages to the browser to tell it it should never show cached pages but
instead always send a new request. Those headers can be a combination of:

Pragma=no-cache (for older browsers)
Cache-control=no-store (a stricter version of no-cache)
Expires=0

Setting these will prevent any non-deaf browser from showing cached content.
That way an invalidated session can be made visible to the user.

Regards,

Silvio Bierman
Jul 17 '05 #3
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<Ea********************@texas.net>...
"gargarensis" <ga*********@terra.es> wrote in message
news:40**************************@posting.google.c om...
I am using invalidate method from the httpSesion class , but when I
press the back button in the internet navigator, the session still is
valid.

HttpSession is an interface, not a class. What makes you think the session
is still valid?


Thanks.

I can access to atrributes for the session after invalidating it.
I am debuging in the "back" request in my servlet.
Jul 17 '05 #4
Thanks.

I can see this, by debuging in the servlet. In first request I delete
all attributes of a session and invalidate it. When I press back, in
next request, I can access to the attributes of session. I try to
implement a web page for disconnection to delete the user data
(password, credit card), but if the user presses back after the
disconnection page it recovers the data.
"Silvio Bierman" <sb******@idfix.nl> wrote in message news:<40***********************@news.xs4all.nl>...
"gargarensis" <ga*********@terra.es> wrote in message
news:40**************************@posting.google.c om...
I am using invalidate method from the httpSesion class , but when I
press the back button in the internet navigator, the session still is
valid.


Invalidating a session is server-side logic, the back-button is purely
client-side logic. You might set the appropriate HTTP headers when you send
pages to the browser to tell it it should never show cached pages but
instead always send a new request. Those headers can be a combination of:

Pragma=no-cache (for older browsers)
Cache-control=no-store (a stricter version of no-cache)
Expires=0

Setting these will prevent any non-deaf browser from showing cached content.
That way an invalidated session can be made visible to the user.

Regards,

Silvio Bierman

Jul 17 '05 #5
"gargarensis" <ga*********@terra.es> wrote in message
news:40**************************@posting.google.c om...
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message

news:<Ea********************@texas.net>...
"gargarensis" <ga*********@terra.es> wrote in message
news:40**************************@posting.google.c om...
I am using invalidate method from the httpSesion class , but when I
press the back button in the internet navigator, the session still is
valid.

HttpSession is an interface, not a class. What makes you think the session is still valid?


Thanks.

I can access to atrributes for the session after invalidating it.
I am debuging in the "back" request in my servlet.


Maybe you should read Silvio's reply a little more closely. If you truly
call session.invalidate(), then the session is gone. Pressing the back
button in your browser is simply pulling the page from your local cache, not
making a new request.
Jul 17 '05 #6
ga*********@terra.es (gargarensis) wrote in message news:<40**************************@posting.google. com>...
Thanks.

I can see this, by debuging in the servlet. In first request I delete
all attributes of a session and invalidate it. When I press back, in
next request, I can access to the attributes of session. I try to
implement a web page for disconnection to delete the user data
(password, credit card), but if the user presses back after the
disconnection page it recovers the data.


If you call the invalidate() method, then the session is gone.

However, on the next call the server will create a new, empty session
whose attributes you can access.

Is it possible that on pressing the back button, you re-submit a form
that sets the attributes in the new session?

Erik
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alexander Jhin | last post by:
I have this very basic Custom Control: public class TestPanel : Panel { public TestPanel() : base() { this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque |...
3
by: RS | last post by:
if i want to invalidate the client area of my Windows.Form and execute an overrided OnPaint i would use Form1.ActiveForm.Invalidate() ?? However, when i use this line of code i receive a : An...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
0
by: swiss | last post by:
how can i code logout in a struts application.I have used session.invalidate but it is not accurately logging out from the session .please help me out to solve this problem.
4
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this...
1
by: sean | last post by:
I'm trying to create "rubber-band" rectangles by overriding the OnPaint method to place rectangles on top of all graphic controls, but when I call Me.Invalidate() (when the user moves the mouse),...
1
by: xsorimachi | last post by:
Hi, I have a computer A which I am logging in but i didn't logout until i go to another computer, computer B. How can I request session from computer A and call HttpSession to invalidate session of...
0
by: raylopez99 | last post by:
Hi, I'm getting into GDI+ Forms 2.0 graphics for C#3 using Visual Studio 2008. One thing I notice: the graphics are really slow and flicker on a Pentium IV, with 2 GB RAM, even with...
5
by: kveerareddy | last post by:
Hi experts, Technologies: Spring, AJAX, Google web tool kit Problem: Ideally when the user stops using a web page then after 30 minutes, if the user is trying to access any ting then the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.