Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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
  #1 (permalink)  
Old March 29th, 2007, 12:43 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default Cookieless Session Question

Hello Everyone,
   I have done some searching around the MSDN and Google and I am not sure there is a way to do this, but I am going to ask anyway.

In the web.config I can set the cookieless property to True which will stop my application from placing a non presistant session cookie on the users pc and instead appends the session id to the URL.

Since this is in the web.config file this is going to be an application wide change which is undesireable in my situation so, what I was wondering if there is some property that will let me switch this on the fly on a per user basis?

So

if(some condition)
{
  //cookieless = true
}
else
{
 //cookieless = false
}

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
__________________
===============================================
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."
===============================================
  #2 (permalink)  
Old March 30th, 2007, 03:58 PM
Friend of Wrox
 
Join Date: Apr 2005
Location: Fort Walton Beach, FL, USA.
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey dparsons:
(You helped me out a few weeks ago.)

I see you are not getting any help here. I'm not either.
Everyone must be on vacation.

Wish I could help you, but I simply don't know enough.
VV


  #3 (permalink)  
Old March 31st, 2007, 03:59 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't think you'll be able to achieve this with what's built in. I wasn't sure if there was a page property that allows you to change the session management settings. Doesn't look like there is, with good reason.

You could try something like URL rewriting to basically duplicate what the regular cookieless session behavior does. That could be done on a per user basis. But then you'd need to make your own session management logic.

-Peter
  #4 (permalink)  
Old March 31st, 2007, 07:58 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Thanks Peter and Victor. No I didn't really think that this would be possible with was built in, but figured I would ask just in case I over looked something, thanks alot though!

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
  #5 (permalink)  
Old April 2nd, 2007, 03:47 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Amman, , Jordan.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons
 Hello Everyone,
I have done some searching around the MSDN and Google and I am not sure there is a way to do this, but I am going to ask anyway.

In the web.config I can set the cookieless property to True which will stop my application from placing a non presistant session cookie on the users pc and instead appends the session id to the URL.

Since this is in the web.config file this is going to be an application wide change which is undesireable in my situation so, what I was wondering if there is some property that will let me switch this on the fly on a per user basis?

So

if(some condition)
{
//cookieless = true
}
else
{
//cookieless = false
}

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
I thought about your case, well there is a solution, but it's not very convenient.

You can place all the forms that are similar in a directory with in the same application directory, and add another web.config file at that directory, so the pages at that directory will have that .config file properties, but the other pages in the web will have the main .config file properties.

Hope that will help you with your case :).



Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"


Similar Threads
Thread Thread Starter Forum Replies Last Post
redirect with SSL/cookieless sessions problems jtyson ASP.NET 1.0 and 1.1 Basics 2 May 29th, 2013 07:32 PM
Cookieless & robots vantoko BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 July 9th, 2007 01:52 AM
redirect with SSL/cookieless sessions befuddlement jtyson ASP.NET 1.0 and 1.1 Professional 1 July 22nd, 2004 05:25 PM





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