|
-
Nov 4th, 2004, 08:52 PM
#1
Thread Starter
Fanatic Member
URL Redirect when not logged in
Allright, pretty much every page of mine has a function that checks if the user is logged in. It also checks if the user has the required access.
Now, what is the best way to return the user to a page if they get redirected to the unauthorized.asp page?
For example:
John wants to access admin.asp but is not logged in and is redirected to unauthroized.asp
Should I just be passing in the URL through a Query String? Or is this not a good way to do it.
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Nov 5th, 2004, 07:08 AM
#2
Hi Alek,
I tend to use Cookies or session to store the last page and redirect them if they are successfuly authenticated...
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Nov 5th, 2004, 07:09 AM
#3
It's a very common way, no harm in doing it. Since each page checks for the authorization level, there's no harm in passing the URL to go to in the URL itself.
-
Nov 5th, 2004, 07:11 AM
#4
Originally posted by mendhak
It's a very common way, no harm in doing it. Since each page checks for the authorization level, there's no harm in passing the URL to go to in the URL itself.
Yep, but sometime time if you need to pass over to 2/3 pages becore redirecting, it is better i think to use cookies/session instead of carrying over those pages. Personal preference i guess .
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Nov 8th, 2004, 04:34 AM
#5
Can't you just have an 'unauthorised.asp' file which is located in the same place for all, or duplicated in each folder, then if they aren't logged in, it just redirects to that file, before sending anything into the browser.
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|