473,657 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirecting to a page after login

Hi,

I want to be able to send users links to pages in my website. But if
they arent logged in I want them to first be redirected to the login
page and after they login automatically be redirected to the page i
sent them in the link. How would i accomplish this.

Thanks for your time and help
:)

Aug 4 '06 #1
3 2366
<%
Dim sTemp: sTemp = Request.ServerV ariables("PATH_ INFO")
Response.Redire ct "/login.asp?ret=" & sTemp
%>

Or

<%
Dim sTemp: sTemp = Request.ServerV ariables("URL")
Response.Redire ct "/login.asp?ret=" & sTemp
%>

Or

<%
Dim sTemp: sTemp = Request.ServerV ariables("SCRIP T_NAME")
Response.Redire ct "/login.asp?ret=" & sTemp
%>

.... and if there's a querystring to go with it;

<%
Dim sTemp: sTemp = Request.ServerV ariables("PATH_ INFO")
Dim sQuery: sQuery = Request.ServerV ariables("QUERY _STRING")
Response.Redire ct "/login.asp?ret=" & sTemp & "?" & sQuery
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Katie" <Dn*********@gm ail.comwrote in message
news:11******** *************@m 73g2000cwd.goog legroups.com...
Hi,

I want to be able to send users links to pages in my website. But if
they arent logged in I want them to first be redirected to the login
page and after they login automatically be redirected to the page i
sent them in the link. How would i accomplish this.

Thanks for your time and help
:)

Aug 4 '06 #2
Katie wrote on 04 aug 2006 in microsoft.publi c.inetserver.as p.general:
Hi,

I want to be able to send users links to pages in my website. But if
they arent logged in I want them to first be redirected to the login
page and after they login automatically be redirected to the page i
sent them in the link. How would i accomplish this.

Thanks for your time and help
:)

<%
session("thisPa ge") = Request.ServerV ariables("SCRIP T_NAME")
if session("logged In") = "" then response.redire ct "\login.asp "
%>
<html>
............

=============== ========

\login.asp

<%
........
if .....
session("logged In") = "Yes !"
response.redire ct session("thisPa ge")
...........
%>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 4 '06 #3
try the free version of www.aspprotect.com
it might give you some ideas other than your redirection scenario which in
my opinion is not the best way to do things

redirection is seldom necessary and usually not the best way to design
things... in your case I think it makes more sense to have every page become
a login page on its own if the person is not logged in.. then take them
right to that same page after login is completed.. why bother redirecting
them somewhere ??

search www.aspin.com as well for many good login scripts

"Katie" <Dn*********@gm ail.comwrote in message
news:11******** *************@m 73g2000cwd.goog legroups.com...
Hi,

I want to be able to send users links to pages in my website. But if
they arent logged in I want them to first be redirected to the login
page and after they login automatically be redirected to the page i
sent them in the link. How would i accomplish this.

Thanks for your time and help
:)

Aug 4 '06 #4

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

Similar topics

1
7672
by: Stu | last post by:
Hi All, I have an ASP.NET application to which I have implemented forms authentication to handle security. It is a relatively straight forward solution with all aspx pages residing in the root folder. The issue I am experiencing is that when the authentication time out is activated and the user is hence unauthenticated, the browser window is on sometimes redirecting back to the login page. When the browser does or doesn't redirect to...
0
1100
by: James Wallace | last post by:
Is it possible to use forms authentication in the web.config file and FormsAuthentication.RedirectFromLoginPage with an asp page so that when the asp page is set to startup page on the project that a redirection will go to the login page and allowing the authentication to occur before going to the asp page. I have an asp page that I want to redirect to after authenticating and if I set the asp as the startup page it starts up with that...
4
3440
by: jjjooooohhnnn | last post by:
Greetings, I have encountered what appears to be a fairly common problem: RedirectFromLoginPage is not redirecting to RedirectUrl. I have tried all the advice that I could on the 'net, and nothing has worked yet. My problem is very simple. I want to redirect from a login page to the default page in one application. I am not crossing over to other applications in other directories on the server. Here is a description of the problem:
1
3762
by: Jeremy Chapman | last post by:
I have built a web app. While testing I have found that if I browse to a page in the app, then get redirected to the login page and enter my credentials. The FormsAuthentication.RedirectFromLoginPage call is redirecting to the default.aspx page rather than the original page the user was at. Here is the details of my application: Web.config: <authentication mode="Forms">
2
1990
by: Gary Coutts | last post by:
Hi, I am have problems redirecting from a login page. The login page is simple, with just 2 textboxes and one button. On the button click the routine below is called: I am using: Visual Studio 2003 Version 7.1.3008 Framework 1.1 Version 1.1.4322 SP1 Windows XP Pro Version 2002 SP2
41
3213
by: amygdala | last post by:
Hello all, I have posted a similar question in comp.lang.php in the past, but haven't had any response to it then. I kinda swept the problem under the rug since then. But I would really like to resolve this issue once and for all now. The problem might be PHP related but since I only develop applications using PHP, I'm not a hundred percent sure. Therefor I've taken the liberty to crosspost to comp.lang.php and alt.www.webmaster. I...
9
2328
by: Jonathan Wood | last post by:
I've spent days trying to come up with a solution. I'd appreciate it if anyone can help. My site requires all users to log on. There are three different roles of users, and each user type will have access to a completely different set of pages. "Client" pages are in the root folder and "Admin" and "Trainer" pages each have their own subfolders. The problem is that when a user goes to the domain, I want to redirect "Admin" and...
0
1154
by: Anup Daware | last post by:
Hi All, I am facing this very weird issue, for every server request my control is redirecting to the login page and again coming back to the actual page from where the request was initiated when I set my custom Remember be cookie on the login page. Following are the details: 1. Authentication mode is ‘Forms’ 2. This issue is reproducible only in deployed applications, I found this using my trace and remote debugging 3. This issue occurs...
6
29744
by: rpcchandu | last post by:
Hi Coders, I have to redirect from my server to the different server page by simulating the POST method submit from the Controller file, I tried using post_via_redirect, but could not succeed... though redirect_to just redirects to given URL, I need to pass parameters using POST. Configurations: Rails 1.2.3, ruby 1.8.6 (2007-03-13 patchlevel 0) Linux 2.6.9-42 box. I used the following code in the action method:...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.