PDA

View Full Version : Cookies not being set?


spookytooth
11-15-2004, 01:39 AM
I have 4 applications running on our account here (CommunityServer Forums, FlexWiki, Gemini, and .Text), and each time i log into them, i ask them to remember who i am, and they never do! These apps work fine on our dev servers here, but they don't seem to want to set cookies at all from your servers.

My sessions also seem to expire quite rapidly. When i am posting to our blog, if i type for more than 5 minutes or so, i am prompted to login again (by both .Text and the forums).

Before you ask - yes each of these apps will remember you via a cookie and i have tested it completely.

Is there a setting in the control panel i can look at? There's nothing in the config files of these apps either.

This is driving me nutso!

Thanks http://community.discountasp.net/emoticons/yeah.gif

jwilley
11-19-2004, 11:50 AM
Here is the code that works for us:
[quote]

'save the pin if user wants to
Dim oAllCookies as Web.HttpCookieCollection=Context.Request.Cookies
Dim oPINCookie as Web.HttpCookie = oAllCookies("OncoEMR1")
if chkRememberPIN.Checked=True then
if oPINCookie is nothing then
oPINCookie = New web.HttpCookie("OncoEMR1")
oPINCookie.Values("RememberMe")=txtPP.Text
oPINCookie.Expires= DateTime.MaxValue ' Never Expires
Context.Response.Cookies.Add(oPINCookie)
else
oPINCookie.Values("RememberMe")=txtPP.Text
Context.Response.Cookies.Set(oPINCookie)
oPINCookie.Expires= DateTime.MaxValue '*must* set exp date even if just updating
end if
Else
'user does not want to save the cookie -- remove it
if NOT oPINCookie is nothing then
oPinCookie.Expires = DateTime.Now.AddDays(-1) 'expired
Response.Cookies.Add(oPinCookie)
end if
End If</CODE>