FormsAuthentication.Encrypt problem

S

Sadashiva Hegde

Hi,

I have a strange problem. I get NULL reference out of
Encrypt function.

FormsAuthenticationTicket ticket = new
FormsAuthenticationTicket(1,
userName,
DateTime.Now,
DateTime.Now.AddMinutes(30),
false,
null,
FormsAuthentication.FormsCookiePath
);

string enc = FormsAuthentication.Encrypt(ticket);

Variable enc contains NULL reference.

Thanks in advance.

Sadashiv
 
M

Mark Berryman

I believe the problem is caused by the lack of user data defined for the
ticket. In your call to the FormsAuthenticationTicket constructor, you're
passing "null" for this. Try including some data (string). That should
work.

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top