登录后复制的URL. [英] Copied URL after Login.

查看:94
本文介绍了登录后复制的URL.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对下一个URL地址有疑问.
问题:
我复制了我的网站网址,例如"Home/Photo.aspx?Id = 1"; ID包含用户的会话ID.
复制网址后,我将注销.

现在,当我尝试将此URL粘贴到地址栏中时,由于会话为null,因此网站页面将我发送到登录页面,而当我登录时,我将重定向到主页.

但是我想进入photo.aspx或我之前复制的任何其他页面URL,而不是登录页面之后出现的home.aspx页面,这怎么可能呢?

I have a problem regarding next URL address.
Problem:
I copy a url of my website like "Home/Photo.aspx?Id=1"; Id contains session id of user.
after copying the url i get logged out.

Now when i try paste this url in the address bar the website page sends me to the login page as the session is null, and when i get login i get redirected to the home page.

But i wanted to go in the photo.aspx or any another page url i have copied previously not the home.aspx page which comes after login page how is this possible?

推荐答案

但是我想进入photo.aspx或我之前复制的任何其他页面URL,而不是登录页面后出现的home.aspx页面,这怎么可能?
1.听起来您没有使用Form的身份验证.如果您使用它,它将自动进行处理.
2.现在,选项是使用状态管理技术之一.使用会话第一次跟踪请求的URL.登录后,检查该会话中是否有任何url(如果有),然后使用它并将页面定向到那里.

尝试!
But i wanted to go in the photo.aspx or any another page url i have copied previously not the home.aspx page which comes after login page how is this possible?
1. Sounds like you are not using Form''s authentication. In case you use that, it would take care of this automatically.
2. Now, the options are to use one of the state management techniques. Use session to keep track of the requested URL for the first time. Once you are logged in, check if any url is there in that session, if so then use it and direct the page there.

Try!


注销
使用表单身份验证注销方法,例如

Formauthentication.RedirectToLoginPage();

它将照顾您的需要.
for logout
use formauthentication logout method like

Formauthentication.RedirectToLoginPage();

It will take care what u need.


这篇关于登录后复制的URL.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆