473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to add FormsAuthenticationTicket to URL

ad
The codes below is copy from msdn about FormsAuthenticationTicket.
It add FormsAuthenticationTicket to cookie.

How can I add the FormsAuthenticationTicket to URL not to Cookie?


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (Membership.ValidateUser(username, password))
{
string userData = "ApplicationSpecific data for this user.";

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
username,
DateTime.Now,
DateTime.Now.AddMinutes(30),
isPersistent,
userData,
FormsAuthentication.FormsCookiePath);

// Encrypt the ticket.
string encTicket = FormsAuthentication.Encrypt(ticket);

// Create the cookie.
Response.Cookies.Add(new
HttpCookie(FormsAuthentication.FormsCookieName, encTicket));

// Redirect back to original URL.
Response.Redirect(FormsAuthentication.GetRedirectU rl(username,
isPersistent));
}
Jan 27 '06 #1
1 1664
Why would you want to add the authentication ticket to the URL? Why dont simply read it from the cookie?

Sonu Kapoor [MVP]
---
Posted via www.DotNetSlackers.com
Jan 27 '06 #2

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

Similar topics

0
by: Fresh Air Rider | last post by:
Hi I have implemented a system of Role-based Security with Forms Authentication in my website which retrieves a comma separated list of user roles via a SQL Server stored procedure. The system...
0
by: MrMike | last post by:
I've successfully implemented forms authentication in my ASP.NET/VB.NET project. I use the FormsAuthenticationTicket to create a cookie on the user's browser when they log on. My question is:...
1
by: Grey | last post by:
I read from some site to learn the form authentication with AD that it needs to create a FormsAuthenticationTicket to store the group list. I want to that what is the function of...
5
by: Kiran B. | last post by:
New to .net... I am wondering if I have a user name as userone and this userone has sepcial sales id 201, how can i associate both userone and 201 in a cookie and access it later on. I can access...
2
by: karunakar | last post by:
Hi All I dont want to expire the applicatoion Once login the application i dont want to expire the application Presently iam doing using cookies this is not working fine Please help me out ...
1
by: Andrew | last post by:
Hi, guys, After I use FormsAuthentication.SetAuthCookie() to anthenticate a user, I don't think I need to create a new FormsAuthenticationTicket(), right? Then, at what situation, we should...
0
by: Andrea | last post by:
If I did something like that: FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(ID, false, 20); then add the ticket encrypting it to the cookie collection, shouldn't the cookie...
1
by: JTourvieille | last post by:
Hi, Does any one knows how to list all FormsAuthenticationTicket available on a server? Thanks
4
by: dev648237923 | last post by:
Upon logon I create a ticket and put some userdata in it: FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 3, //Version tUsername.Text, //Username DateTime.Now, ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...

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.