serve new home page based on variable or no variable
OK, i havent worked with asp and cookies together before. I have a new page design and an old one. the html is contained in 2 subs, SUB OLDPAGE and SUB NEWPAGE.
This is what Im trying to do
- user goes to www.mysite.com/ and gets OLDPAGE by default
- user goes to www.mysite.come/?nsmc=new . I want to then set a cookie for 30 days storing the cookie "nsmc" as equaling "new" , then user gets NEWPAGE
- user goes to www.mysite.com/ ( nsmc cookie shoudl now equal new) and serves NEWPAGE
- user goes to www.mysite.com/?nsmc=old - then set cookie nsmc to "old and serve OLDPAGE
on subsequent visits to www.mysite.com user will again get OLDPAGE
ok, so this is what I have
ahh nevermind I figured it out. My code was "working" but to do it the way i want I have to prevent client side page caching so I put this at the top of the pages and it works as i wanted now
Ummm...no, I don't think that will work.
You can't use Request.Cookies to get the cookie you JUST SET using Response.Cookies.
Request.Cookies *ONLY* shows you the cookies that were present at the time the user's HTTP request was made.
So if the cookies were set to "old" and the query string said "new", then Request.Cookies would still be "old" and the query string would NOT take effect until the next time the user got to the page.
Ahh I see. Ill have to give that a shot. I ended up using server.transfer, but I wanted to figure out how to do it the way I wanted to do it :)
Ill give is a shot on Monday, no wait Tuesday. ( Monday is Sharepoint 2007 to 2010 migration yikes!)
|All times are GMT +1. The time now is 12:18 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.