Ask a Question related to ASP.NET Security, Design and Development.
-
JC Foust #1
Find Cookie Else Redirect
Hello
I'm in the finishing stages of a new CMS site and we've recently discovered a tear-out-my-hair authentication problem. Essentially, what I have is a news site. We list articles on the index page requiring registration. What I need to do is this
When a user clicks on an article headline/url i need to check and see if they have our cookie. If they don't, they need to be redirected to our login page. Now, the login page is legacy ASP, plain and simple. THAT page works if I manually go to it and login (cookie gets set and all).
The problem is that I cannot get the individual article page (aspx page) to check for cookies and redirect to the ASP page. I've googled this until my fingers bleed and I completely understand forms authentication, but my little red-headed-stepchild procedure will not work. Can anyone help??
Here's the latest inline code I've tried (feel free to laugh, I'm nearly a neophyte here)
<script runat="server" language="vb"
Sub Page_Load(Sender As [Object], e As EventArgs
Dim myCookieName As HttpCookie = Request.Cookies("yourein"
'Check to make sure the cookie exist
If myCookieName Is False The
Response.Redirect("/mysite/login/login.asp"
End I
End Su
</script
Thanks so much
J
JC Foust Guest
-
Cookie not set after login and redirect
Hello I have setup a forms authentication login page and use custom principal and identity. When authenticate everything goes well. But when I set... -
Cookie not created with Response.Redirect
What is the difference between these two methods? The first one does NOT write a Cookie...and the second one does write the cookie. Anyone... -
set a cookie and redirect using CGI.pm
Hello I want to set a user cookie and redirect to a different URL on the same domain. I searched and found alternate ways of doing it. I am... -
sending session cookie before redirect
Hi! I have a function in a lot of pages, which redirects to a new page, if a form has been submitted: if (!(defined("DEBUG_INSERT") &&... -
Cookies set one time, I delete cookie, cookie is never set again!
I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes,... -
David Coe, MCP #2
RE: Find Cookie Else Redirect
You may also want to make sure the cookie exists by doing an IsNothing() check on it as well. For more info, check out [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp[/url]. I had a coworker with the same problem and this seemed to help him out.
David Coe, MCP Guest



Reply With Quote

