Ask a Question related to ASP.NET General, Design and Development.
-
Cookie munging problem
Hi,
I'm trying to use the cookie munging session handling behaviour of asp.net
instead of cookies themselves as I'm finding quite a few people are barring
cookies (especially AOL users). If I change the setting in web.config
everything seems to work fine as long as I'm using relative paths. The
problem is I've got a menuing system that's generated from a site-wide
template - so I use a fixed path from the application root - (ie:
/application/sub-dir/page.aspx) because I don't actually know where the
user is at any given moment because it's a site-wide menu.
Whenever someone clicks on one of them, the Session ID gets wiped from the
URL and the user gets logged out. Am I missing something really stupid
here? How can I persist the SessionID in these URLs?
Cheers
Chris
Guest
-
Cookie Problem -Please Help
Hello Everyone, I have a little problem. I want to create a cookie and if the user deciced to close the browser, I want that cookie deleted... -
PHP Cookie Problem
Hi guys, I've got a section of my site where I've integrated a rating script. Seems to work okay expect what I've noticed is that with the... -
Cookie problem
I like cookies, you can send me some "Onur Bozkurt" <onur.bozkurt@softhome.net> wrote in message news:eC9xJP7PDHA.1624@tk2msftngp13.phx.gbl... -
problem with cookie
Jose wrote: i may be wrong on this, but i would be surprised if a cookie's key is allowed to have the apostrophe character in it. Check your... -
String Munging with ASP/Access DB
Use: parrTemp = Split("string", " ") Now has an array of all the words. Just choose them by a random integer. eg. -
Seaside #2
Re: Cookie munging problem
I had the same problem and wound up changing the menu system so that my
navigation is in 4 different controls vs. one. Each control is located in a
position so that it can use relative paths with respect to the page. Instead
of making a change in one nav control I have to make it in 4 but it is still
worth it in order to use cookie munging. My users refuse to allow cookies.
Hope your post results in a better option , I'd love to get back to using
one nav control vs 4.
<chris@yahoo.com> wrote in message
news:exGegPBWDHA.208@tk2msftngp13.phx.gbl...barring> Hi,
>
> I'm trying to use the cookie munging session handling behaviour of asp.net
> instead of cookies themselves as I'm finding quite a few people are> cookies (especially AOL users). If I change the setting in web.config
> everything seems to work fine as long as I'm using relative paths. The
> problem is I've got a menuing system that's generated from a site-wide
> template - so I use a fixed path from the application root - (ie:
> /application/sub-dir/page.aspx) because I don't actually know where the
> user is at any given moment because it's a site-wide menu.
>
> Whenever someone clicks on one of them, the Session ID gets wiped from the
> URL and the user gets logged out. Am I missing something really stupid
> here? How can I persist the SessionID in these URLs?
>
> Cheers
>
> Chris
>
>
Seaside Guest
-
Seaside #3
Re: Cookie munging problem
Well that looks interesting. All of my navigation links are generated using
the asp server side controls. Hadn't thought of using the code behind to set
up the urls though. Can you give me a bit of help in getting started on
this? For example if I have the following:
Root
default.aspx consisting of 1 nav user control nav.ascx
Root/subfolderA
PageA.aspx consisting of 1 nav user control nav.ascx
Root/subfolderA/subfolderB
PageAB.aspx consisting of 1 nav user control nav.ascx
Right now I would have to code each user control seperately based on their
relative position in the web even though each nav.ascx displays all the
files the user needs to get to. (of course the premise is that I wish to
continue to use cookie munging.) This is because each user control is
relative depending on the aspx page that calls it vs where it (the ascx)
actually exists.
If I understand your suggestion correctly you are saying that I could keep
one (my root for example) nav.ascx and use it from any aspx page within the
heirarchy by referencing the session.sessionid in the nav.ascx code behind?I
f that is true it would certainly solve the problem.
Can you give me a simple (I'm not very bright) example of the code for the
code behind and the ascx code for a couple of levels (maybe using the folder
structure I mentioned earlier)? Actually just one would probably do me. For
example how would I reference the session.sessionid in the code behind and
then retrieve that in the asp hyperlink?
Thanks in advance.
<chris@yahoo.com> wrote in message
news:enpZITJWDHA.2268@TK2MSFTNGP11.phx.gbl...menu> Hi Seaside,
>
> I think I've figured out how to do it. May or may not work for you. Mysjkfj23....> is an asp.net menu created server side, so i've basically changed the base
> url (ie: "/site/") to "/site/(sjkfj23jsdfjlsdkfj)/" note - theit's> etc. is referenced in code behind using session.sessionID
>
> If your menu is generated server side, then this will work for you. Ifin> just a client-side menu that you don't generate in code, then it won't.
>
> Hope that helps???
>
> Chris
>
>
>
>
>
> "Seaside" <ss@hotmail.com> wrote in message
> news:uuAaOjCWDHA.1352@TK2MSFTNGP10.phx.gbl...> > I had the same problem and wound up changing the menu system so that my
> > navigation is in 4 different controls vs. one. Each control is locatedcookies.> a> Instead> > position so that it can use relative paths with respect to the page.> still> > of making a change in one nav control I have to make it in 4 but it is> > worth it in order to use cookie munging. My users refuse to allowusing> > Hope your post results in a better option , I'd love to get back toThe> asp.net> > one nav control vs 4.
> >
> >
> > <chris@yahoo.com> wrote in message
> > news:exGegPBWDHA.208@tk2msftngp13.phx.gbl...> > > Hi,
> > >
> > > I'm trying to use the cookie munging session handling behaviour of> > barring> > > instead of cookies themselves as I'm finding quite a few people are> > > cookies (especially AOL users). If I change the setting in web.config
> > > everything seems to work fine as long as I'm using relative paths.the> > > problem is I've got a menuing system that's generated from a site-wide
> > > template - so I use a fixed path from the application root - (ie:
> > > /application/sub-dir/page.aspx) because I don't actually know wherestupid> the> > > user is at any given moment because it's a site-wide menu.
> > >
> > > Whenever someone clicks on one of them, the Session ID gets wiped from> > > URL and the user gets logged out. Am I missing something really>> >> > > here? How can I persist the SessionID in these URLs?
> > >
> > > Cheers
> > >
> > > Chris
> > >
> > >
> >
>
Seaside Guest
-
Re: Cookie munging problem
Sure, it's simple.
Basically, use only one nav.ascx.
When you set up the urls, do so server side using absolute links instead of
relative.
So for example, let's assume your application is called MyApp and it's in a
virtualdirectory called MyApp.
It's root directory looks like:
default.aspx
subfolderA/page1.aspx
subfolderB/page2.aspx
All 3 pages have the same nav.ascx control.
The URLs would have to be generated server side, so you'd have to do
something like (assuming nav.ascx code behind is a class called nav):
nav.HomeURL = "/MyApp/(" + session.sessionID + ")/Default.aspx"
nav.Page1URL = "/MyApp/(" + session.sessionID + ")/subfolderA/page1.aspx"
nav.Page2URL = "/MyApp/(" + session.sessionID + ")/subfolderB/page2.aspx"
This definately does work - as i've got it working on my site. Now the only
problem is if the user leaves the site (like to go to a credit card
processing page hosted elsewhere) and comes back - you need to persist the
sessionID somehow....
Hope that helps
Chris
"Seaside" <ss@hotmail.com> wrote in message
news:eY5nO%23OWDHA.3924@tk2msftngp13.phx.gbl...using> Well that looks interesting. All of my navigation links are generatedset> the asp server side controls. Hadn't thought of using the code behind tothe> up the urls though. Can you give me a bit of help in getting started on
> this? For example if I have the following:
>
> Root
> default.aspx consisting of 1 nav user control nav.ascx
>
> Root/subfolderA
> PageA.aspx consisting of 1 nav user control nav.ascx
>
> Root/subfolderA/subfolderB
> PageAB.aspx consisting of 1 nav user control nav.ascx
>
>
> Right now I would have to code each user control seperately based on their
> relative position in the web even though each nav.ascx displays all the
> files the user needs to get to. (of course the premise is that I wish to
> continue to use cookie munging.) This is because each user control is
> relative depending on the aspx page that calls it vs where it (the ascx)
> actually exists.
>
> If I understand your suggestion correctly you are saying that I could keep
> one (my root for example) nav.ascx and use it from any aspx page withinbehind?I> heirarchy by referencing the session.sessionid in the nav.ascx codefolder> f that is true it would certainly solve the problem.
>
> Can you give me a simple (I'm not very bright) example of the code for the
> code behind and the ascx code for a couple of levels (maybe using theFor> structure I mentioned earlier)? Actually just one would probably do me.base> example how would I reference the session.sessionid in the code behind and
> then retrieve that in the asp hyperlink?
>
> Thanks in advance.
>
>
>
>
> <chris@yahoo.com> wrote in message
> news:enpZITJWDHA.2268@TK2MSFTNGP11.phx.gbl...> menu> > Hi Seaside,
> >
> > I think I've figured out how to do it. May or may not work for you. My> > is an asp.net menu created server side, so i've basically changed themy> sjkfj23....> > url (ie: "/site/") to "/site/(sjkfj23jsdfjlsdkfj)/" note - the> it's> > etc. is referenced in code behind using session.sessionID
> >
> > If your menu is generated server side, then this will work for you. If> > just a client-side menu that you don't generate in code, then it won't.
> >
> > Hope that helps???
> >
> > Chris
> >
> >
> >
> >
> >
> > "Seaside" <ss@hotmail.com> wrote in message
> > news:uuAaOjCWDHA.1352@TK2MSFTNGP10.phx.gbl...> > > I had the same problem and wound up changing the menu system so thatweb.config> in> > > navigation is in 4 different controls vs. one. Each control is located> cookies.> > a> > Instead> > > position so that it can use relative paths with respect to the page.> > still> > > of making a change in one nav control I have to make it in 4 but it is> > > worth it in order to use cookie munging. My users refuse to allow> using> > > Hope your post results in a better option , I'd love to get back to> > asp.net> > > one nav control vs 4.
> > >
> > >
> > > <chris@yahoo.com> wrote in message
> > > news:exGegPBWDHA.208@tk2msftngp13.phx.gbl...
> > > > Hi,
> > > >
> > > > I'm trying to use the cookie munging session handling behaviour of> > > > instead of cookies themselves as I'm finding quite a few people are
> > > barring
> > > > cookies (especially AOL users). If I change the setting insite-wide> The> > > > everything seems to work fine as long as I'm using relative paths.> > > > problem is I've got a menuing system that's generated from afrom> the> > > > template - so I use a fixed path from the application root - (ie:
> > > > /application/sub-dir/page.aspx) because I don't actually know where> > > > user is at any given moment because it's a site-wide menu.
> > > >
> > > > Whenever someone clicks on one of them, the Session ID gets wiped> stupid> > the> > > > URL and the user gets logged out. Am I missing something really>> >> > > > here? How can I persist the SessionID in these URLs?
> > > >
> > > > Cheers
> > > >
> > > > Chris
> > > >
> > > >
> > >
> > >
> >
>
Guest
-
Seaside #5
Re: Cookie munging problem
Super! Thanks bunches!
<chris@yahoo.com> wrote in message
news:uAr8$qPWDHA.1280@tk2msftngp13.phx.gbl...of> Sure, it's simple.
>
> Basically, use only one nav.ascx.
>
> When you set up the urls, do so server side using absolute links insteada> relative.
>
> So for example, let's assume your application is called MyApp and it's inonly> virtualdirectory called MyApp.
>
> It's root directory looks like:
>
> default.aspx
> subfolderA/page1.aspx
> subfolderB/page2.aspx
>
> All 3 pages have the same nav.ascx control.
>
> The URLs would have to be generated server side, so you'd have to do
> something like (assuming nav.ascx code behind is a class called nav):
>
> nav.HomeURL = "/MyApp/(" + session.sessionID + ")/Default.aspx"
> nav.Page1URL = "/MyApp/(" + session.sessionID + ")/subfolderA/page1.aspx"
> nav.Page2URL = "/MyApp/(" + session.sessionID + ")/subfolderB/page2.aspx"
>
> This definately does work - as i've got it working on my site. Now thetheir> problem is if the user leaves the site (like to go to a credit card
> processing page hosted elsewhere) and comes back - you need to persist the
> sessionID somehow....
>
> Hope that helps
>
> Chris
>
> "Seaside" <ss@hotmail.com> wrote in message
> news:eY5nO%23OWDHA.3924@tk2msftngp13.phx.gbl...> using> > Well that looks interesting. All of my navigation links are generated> set> > the asp server side controls. Hadn't thought of using the code behind to> > up the urls though. Can you give me a bit of help in getting started on
> > this? For example if I have the following:
> >
> > Root
> > default.aspx consisting of 1 nav user control nav.ascx
> >
> > Root/subfolderA
> > PageA.aspx consisting of 1 nav user control nav.ascx
> >
> > Root/subfolderA/subfolderB
> > PageAB.aspx consisting of 1 nav user control nav.ascx
> >
> >
> > Right now I would have to code each user control seperately based onkeep> > relative position in the web even though each nav.ascx displays all the
> > files the user needs to get to. (of course the premise is that I wish to
> > continue to use cookie munging.) This is because each user control is
> > relative depending on the aspx page that calls it vs where it (the ascx)
> > actually exists.
> >
> > If I understand your suggestion correctly you are saying that I couldthe> the> > one (my root for example) nav.ascx and use it from any aspx page within> behind?I> > heirarchy by referencing the session.sessionid in the nav.ascx code> > f that is true it would certainly solve the problem.
> >
> > Can you give me a simple (I'm not very bright) example of the code forand> folder> > code behind and the ascx code for a couple of levels (maybe using the> For> > structure I mentioned earlier)? Actually just one would probably do me.> > example how would I reference the session.sessionid in the code behindMy> > then retrieve that in the asp hyperlink?
> >
> > Thanks in advance.
> >
> >
> >
> >
> > <chris@yahoo.com> wrote in message
> > news:enpZITJWDHA.2268@TK2MSFTNGP11.phx.gbl...> > > Hi Seaside,
> > >
> > > I think I've figured out how to do it. May or may not work for you.If> base> > menu> > > is an asp.net menu created server side, so i've basically changed the> > sjkfj23....> > > url (ie: "/site/") to "/site/(sjkfj23jsdfjlsdkfj)/" note - the> > > etc. is referenced in code behind using session.sessionID
> > >
> > > If your menu is generated server side, then this will work for you.won't.> > it's> > > just a client-side menu that you don't generate in code, then itlocated> my> > >
> > > Hope that helps???
> > >
> > > Chris
> > >
> > >
> > >
> > >
> > >
> > > "Seaside" <ss@hotmail.com> wrote in message
> > > news:uuAaOjCWDHA.1352@TK2MSFTNGP10.phx.gbl...
> > > > I had the same problem and wound up changing the menu system so that> > > > navigation is in 4 different controls vs. one. Each control isis> > in> > > a
> > > > position so that it can use relative paths with respect to the page.
> > > Instead
> > > > of making a change in one nav control I have to make it in 4 but itare> > cookies.> > > still
> > > > worth it in order to use cookie munging. My users refuse to allow> > using> > > > Hope your post results in a better option , I'd love to get back to> > > > one nav control vs 4.
> > > >
> > > >
> > > > <chris@yahoo.com> wrote in message
> > > > news:exGegPBWDHA.208@tk2msftngp13.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > I'm trying to use the cookie munging session handling behaviour of
> > > asp.net
> > > > > instead of cookies themselves as I'm finding quite a few peoplewhere> web.config> > > > barring
> > > > > cookies (especially AOL users). If I change the setting in> site-wide> > The> > > > > everything seems to work fine as long as I'm using relative paths.> > > > > problem is I've got a menuing system that's generated from a> > > > > template - so I use a fixed path from the application root - (ie:
> > > > > /application/sub-dir/page.aspx) because I don't actually know> from> > the> > > > > user is at any given moment because it's a site-wide menu.
> > > > >
> > > > > Whenever someone clicks on one of them, the Session ID gets wiped>> > stupid> > > the
> > > > > URL and the user gets logged out. Am I missing something really> >> > > > > here? How can I persist the SessionID in these URLs?
> > > > >
> > > > > Cheers
> > > > >
> > > > > Chris
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Seaside Guest
-
Seaside #6
Re: Cookie munging problem
Ooops. I seem to be running into a problem. Perhaps I don't fully grasp the
technique although I appreciate the concept.
When you say
of> When you set up the urls, do so server side using absolute links insteadYou mean using a <asp:hyperlink runat: = "server"> tag.....correct?> relative.
If so then in the NavigateUrl="" attribute of the asp:hyperlink I would
place the variable which was referenced in the code behind for that
particular URL. For example <asp:hyperlink runat: = "server"
navigateurl=nav.HomeUrl >
Is that correct?
If so then I must not be setting the reference correctly in the code behind
of the nav.ascx. Where in the code behind and how are you placing that
reference? I tried dimming a variable as a string inside the code behind
class and then assigning the absolute path as you instructed but I suspect
that I didn't do it correctly because it couldn't find the page. I can't
figure out if I'm not setting the reference correctly or I'm not using the
reference correctly in the <asp:hyperlink> tag.
Thanks again.
<chris@yahoo.com> wrote in message
news:uAr8$qPWDHA.1280@tk2msftngp13.phx.gbl...of> Sure, it's simple.
>
> Basically, use only one nav.ascx.
>
> When you set up the urls, do so server side using absolute links insteada> relative.
>
> So for example, let's assume your application is called MyApp and it's inonly> virtualdirectory called MyApp.
>
> It's root directory looks like:
>
> default.aspx
> subfolderA/page1.aspx
> subfolderB/page2.aspx
>
> All 3 pages have the same nav.ascx control.
>
> The URLs would have to be generated server side, so you'd have to do
> something like (assuming nav.ascx code behind is a class called nav):
>
> nav.HomeURL = "/MyApp/(" + session.sessionID + ")/Default.aspx"
> nav.Page1URL = "/MyApp/(" + session.sessionID + ")/subfolderA/page1.aspx"
> nav.Page2URL = "/MyApp/(" + session.sessionID + ")/subfolderB/page2.aspx"
>
> This definately does work - as i've got it working on my site. Now thetheir> problem is if the user leaves the site (like to go to a credit card
> processing page hosted elsewhere) and comes back - you need to persist the
> sessionID somehow....
>
> Hope that helps
>
> Chris
>
> "Seaside" <ss@hotmail.com> wrote in message
> news:eY5nO%23OWDHA.3924@tk2msftngp13.phx.gbl...> using> > Well that looks interesting. All of my navigation links are generated> set> > the asp server side controls. Hadn't thought of using the code behind to> > up the urls though. Can you give me a bit of help in getting started on
> > this? For example if I have the following:
> >
> > Root
> > default.aspx consisting of 1 nav user control nav.ascx
> >
> > Root/subfolderA
> > PageA.aspx consisting of 1 nav user control nav.ascx
> >
> > Root/subfolderA/subfolderB
> > PageAB.aspx consisting of 1 nav user control nav.ascx
> >
> >
> > Right now I would have to code each user control seperately based onkeep> > relative position in the web even though each nav.ascx displays all the
> > files the user needs to get to. (of course the premise is that I wish to
> > continue to use cookie munging.) This is because each user control is
> > relative depending on the aspx page that calls it vs where it (the ascx)
> > actually exists.
> >
> > If I understand your suggestion correctly you are saying that I couldthe> the> > one (my root for example) nav.ascx and use it from any aspx page within> behind?I> > heirarchy by referencing the session.sessionid in the nav.ascx code> > f that is true it would certainly solve the problem.
> >
> > Can you give me a simple (I'm not very bright) example of the code forand> folder> > code behind and the ascx code for a couple of levels (maybe using the> For> > structure I mentioned earlier)? Actually just one would probably do me.> > example how would I reference the session.sessionid in the code behindMy> > then retrieve that in the asp hyperlink?
> >
> > Thanks in advance.
> >
> >
> >
> >
> > <chris@yahoo.com> wrote in message
> > news:enpZITJWDHA.2268@TK2MSFTNGP11.phx.gbl...> > > Hi Seaside,
> > >
> > > I think I've figured out how to do it. May or may not work for you.If> base> > menu> > > is an asp.net menu created server side, so i've basically changed the> > sjkfj23....> > > url (ie: "/site/") to "/site/(sjkfj23jsdfjlsdkfj)/" note - the> > > etc. is referenced in code behind using session.sessionID
> > >
> > > If your menu is generated server side, then this will work for you.won't.> > it's> > > just a client-side menu that you don't generate in code, then itlocated> my> > >
> > > Hope that helps???
> > >
> > > Chris
> > >
> > >
> > >
> > >
> > >
> > > "Seaside" <ss@hotmail.com> wrote in message
> > > news:uuAaOjCWDHA.1352@TK2MSFTNGP10.phx.gbl...
> > > > I had the same problem and wound up changing the menu system so that> > > > navigation is in 4 different controls vs. one. Each control isis> > in> > > a
> > > > position so that it can use relative paths with respect to the page.
> > > Instead
> > > > of making a change in one nav control I have to make it in 4 but itare> > cookies.> > > still
> > > > worth it in order to use cookie munging. My users refuse to allow> > using> > > > Hope your post results in a better option , I'd love to get back to> > > > one nav control vs 4.
> > > >
> > > >
> > > > <chris@yahoo.com> wrote in message
> > > > news:exGegPBWDHA.208@tk2msftngp13.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > I'm trying to use the cookie munging session handling behaviour of
> > > asp.net
> > > > > instead of cookies themselves as I'm finding quite a few peoplewhere> web.config> > > > barring
> > > > > cookies (especially AOL users). If I change the setting in> site-wide> > The> > > > > everything seems to work fine as long as I'm using relative paths.> > > > > problem is I've got a menuing system that's generated from a> > > > > template - so I use a fixed path from the application root - (ie:
> > > > > /application/sub-dir/page.aspx) because I don't actually know> from> > the> > > > > user is at any given moment because it's a site-wide menu.
> > > > >
> > > > > Whenever someone clicks on one of them, the Session ID gets wiped>> > stupid> > > the
> > > > > URL and the user gets logged out. Am I missing something really> >> > > > > here? How can I persist the SessionID in these URLs?
> > > > >
> > > > > Cheers
> > > > >
> > > > > Chris
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Seaside Guest



Reply With Quote

