English 中文(简体)
如果用户已经贴上同一浏览器和p.net c
原标题:Redirect to Home page if user already logged in, in same browser asp .net c#
  • 时间:2011-09-10 08:28:05
  •  标签:
  • asp.net

I want to make application that if user in logged in the web site in one tab of browser and if he open application in second tab than he should not redirect to login page but he should redirect to Home page. just like Facebook or yahoomail in asp.net C#

帮助

问题回答

为此,你应当使用一种持续的 au。 这将使认证得以维持。 http://msdn.microsoft.com/en-us/library/twk5762b.aspx”rel=“nofollow”>。

FormsAuthentication.SetAuthCookie("name", true); // persistant auth cookie

You can set a custom session attribute in Session_Start method in Global.asax, and when home page loads check that assigned session still available or not, if it exists still then redirect to logged page.

如果(Session[“UserId”]!= 无)

我希望这将有助于你。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签