Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2006, 01:47 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default Cookies Problem

Hello everyone,
   I am doing some work with FormsAuthenctication and have stumbled upon a slight problem. When i call FormsAuthentication.RedirectFromLoginPage([username],[boolean]) this works wonderfully and the user is logged on.

Here is my problem: Using just the above method I am able to use User.Identity to determine who is logged on to my website but I also need to store some other pertinent data so I created a custom cookie to store this data and added it via Response.Cookies.Add()

After implementing this, my FormsAuthetication doesn't appear to be working as User.Identity is returning NULL but, moreover, my custom cookie also comes back as null as well.

I searched on google and came up with the FormsAuthenticationTicket that has a paramerter "UserData" which i can supply to it. This, apparently will wrap up the userlogon and any custom data that I want to add. Unfortunately I lose the ability to reference a Key/Value pair doing it like this and am only able to return the string passed into the ticket. (Which then requires string manipulation to return my values)

So, is there a way to A)Get FormsAutehntication to work with my custom cookies or B)A way to pass in, say, an array or another cookie to a FormsAuthenticationTicket??

Thanks all.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with cookies khb3283 ASP.NET 2.0 Basics 1 October 1st, 2008 11:11 AM
cookies problem kanoorani Servlets 0 December 22nd, 2006 10:54 AM
Problem with using cookies JSB Beginning PHP 0 November 25th, 2005 11:58 AM
Problem with cookies :( Varg_88 Classic ASP Databases 2 December 13th, 2004 11:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.