Multimobile Development: Building Applications for any Smartphone
Cookieless Forms Authentication?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.


Toby Couchman
Hi,
Does anyone know if it is possible to use Forms Authentication without using
cookies? perhaps using a similar method to the cookie-less session
handling..

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
    
Rohan Cragg
Yes, you change a setting in the Web.config file

i.e. <sessionState cookieless="true" />

try this and you will notice that a reference to the session is passed in
the URL...

hth Rohan.

"Toby Couchman" <Click here to reveal e-mail address> wrote in message
news:e6FMKfQ8BHA.2016@tkmsftngp03...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
First volume of Multimobile Development nearly ready to go to press
A mention on Developing for the iPhone and Android: The pros and cons
 
    
Toby Couchman
yeah I know thats how to make the session cookie-less, but what about the
Forms Authentication?

"Rohan Cragg" <Click here to reveal e-mail address> wrote in message
news:uIcRVXS8BHA.2332@tkmsftngp03...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Rad
what do the docs say?

"Toby Couchman" <Click here to reveal e-mail address> wrote in message
news:eY1WFfT8BHA.1632@tkmsftngp05...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
First chapters of Multimobile Development book now available on Apress Alpha program
iPad
 
    
Rohan Cragg
I may be missing the point here but, could you not just store whatever
information you wanted to remember about the visitor in a session
variable?...

' assuming user enters their name and clicks a submit button:
' in the click event of the button you could put this:

Session.Add("Name", txtName.Text)

' and the get back the name on another page you simply query the session:

lblName.Text = CType(Session("Name"), String)

' Session variables are always just Objects, so you have to specify the type
if you have Option Strict = On

hth... Rohan.

"Toby Couchman" <Click here to reveal e-mail address> wrote in message
news:eY1WFfT8BHA.1632@tkmsftngp05...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
New book project – Multimobile Development: Building Applications for any Smartphone
Dive into HTML5
 
    
Shark Attack
Yes, it's possible.

What you have to do is create your own ticket:
i.e:

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(username,
false, 20);

then encrypt it:
string sTicket = FormsAuthentication.Encrypt(ticket);

and redirect to the return URL with the encrypted cookie tacked on the URL:
Response.Redirect(Request.QueryString["ReturnURL"] + "?.ASPXAUTH=" +
sTicket);

(you might want to check if there is are query string parameters already. In
such case put a '&' instead of the '?')

However, the only problem is that on each Page_Load event you will have to
scan your page for all links and add the encrypted ticket to them as well.

Cheers.

"Toby Couchman" <Click here to reveal e-mail address> wrote in message
news:e6FMKfQ8BHA.2016@tkmsftngp03...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
 
System.Web.Security.FormsAuthentication
System.Web.Security.FormsAuthenticationTicket




Multimobile Development: Building Applications for any Smartphone
Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734