Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2009, 12:55 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default Abandon session and call authentication.

Hello Friends!
I am using Timer and as the time reaches to 5 seconds I am trying to abandon the session but it is not happening with session.abandon method but when I am using Session.Clear() method then Session are being clear after that I am redirecting my login page which is HomePage.aspx but after redirecting the Homepage.aspx if I paste the URL of my previous page then it is going successfully to it I dont want it to go back to the previous page untill User authenticate the Login Page. how can I do this please suggest me. I have set the authentication also.



protected void Timer1_Tick(object sender, EventArgs e)
{
Session["scnds"] = Int32.Parse(Session["scnds"].ToString()) + 1;
Label1.Text = Session["scnds"].ToString();
ReSetTime += 1;

if ( Int32.Parse(Session["scnds"].ToString()) == 5)
{
Session.Abandon();
Response.Redirect("HomePage.aspx");
}
}


Thanks!
__________________
DPK..
 
Old September 29th, 2009, 06:35 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Would it help to prevent caching of the current page?

Response.Cache.SetCacheability(HttpCacheability.No Cache)


Alternatively redirect to a page that is where No Caching is allowed, abandon the session in this page and then divert to the login page?








Similar Threads
Thread Thread Starter Forum Replies Last Post
session.abandon() sarah lee ASP.NET 1.0 and 1.1 Basics 4 December 11th, 2006 06:10 PM
Session.Abandon problem r_ganesh76 General .NET 13 October 4th, 2004 11:20 PM
session.abandon!! cici Classic ASP Professional 1 April 16th, 2004 12:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.