Greg Hauptmann
2007-Jul-03 21:48 UTC
how can I create a 2nd/separate cookie for my app?? (i.e. and not use the session tracking cookie)
Hi, How can I create a 2nd/separate cookie for my app (i.e. and not use the session tracking cookie). Is this possible? Currently the timezone id I''m saving via "cookies[:tz]" gets stored ok in the application cookie (along with session_id etc), however the session cookie disappears after the browser is closed - and I don''t want to keep this session cookie "alive" longer than this. Tks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jon Garvin
2007-Jul-03 22:05 UTC
Re: how can I create a 2nd/separate cookie for my app?? (i.e. and not use the session tracking cookie)
Greg Hauptmann wrote:> Hi, > > How can I create a 2nd/separate cookie for my app (i.e. and not use the > session tracking cookie). Is this possible? > > Currently the timezone id I''m saving via "cookies[:tz]" gets stored ok in > the application cookie (along with session_id etc), however the session > cookie disappears after the browser is closed - and I don''t want to keep > this session cookie "alive" longer than this. > > Tks >That sound to me like the kind of thing you might want to be storing in the users table. -- http://www.5valleys.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
wolfmanjm
2007-Jul-03 22:09 UTC
Re: how can I create a 2nd/separate cookie for my app?? (i.e. and not use the session tracking cookie)
I use this in my controller... cookies[:_my_host_tz]= { :value => "PST", :expires => 30.days.from_now, :path => "/" } and checking in Firefox, it does create a separate cookie from the sessions cookie. there is a _my_host_session_id and a _my_host_tz cookie. On Jul 3, 2:48 pm, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > How can I create a 2nd/separate cookie for my app (i.e. and not use the > session tracking cookie). Is this possible? > > Currently the timezone id I''m saving via "cookies[:tz]" gets stored ok in > the application cookie (along with session_id etc), however the session > cookie disappears after the browser is closed - and I don''t want to keep > this session cookie "alive" longer than this. > > Tks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2007-Jul-03 22:12 UTC
Re: how can I create a 2nd/separate cookie for my app?? (i.e. and not use the session tracking cookie)
oh, perhaps I was misinterpreting the "see cookie info" from the web developer firefox plugin (i.e. thought it was the same cookie) - let me try this wolfmanjm - tks` On 7/4/07, wolfmanjm <wolfmanjm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I use this in my controller... > > cookies[:_my_host_tz]= { :value => "PST", :expires => > 30.days.from_now, :path => "/" } > > and checking in Firefox, it does create a separate cookie from the > sessions cookie. > there is a _my_host_session_id and a _my_host_tz cookie. > > On Jul 3, 2:48 pm, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hi, > > > > How can I create a 2nd/separate cookie for my app (i.e. and not use the > > session tracking cookie). Is this possible? > > > > Currently the timezone id I''m saving via "cookies[:tz]" gets stored ok > in > > the application cookie (along with session_id etc), however the session > > cookie disappears after the browser is closed - and I don''t want to keep > > this session cookie "alive" longer than this. > > > > Tks > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2007-Jul-03 23:14 UTC
Re: how can I create a 2nd/separate cookie for my app?? (i.e. and not use the session tracking cookie)
PS. How are you accessing the timezone info in your app out of curiosity? I''ve doing the following. Any comments welcomed? * I''m not accessing via the cookie as if it''s not set and I set it in a before filter it remains unset until the next browser request, so what I''m doing is: * Application code accesses value from session, with cookie value being used when browser closed/opened. * When even setting timezone in app set both cookie & session. * BeforeFilter = Ensure that both session and cookie contains value. If cookie is nil then set it with with session value and vica versa. If both are nil then set a default in both cookie and session On 7/4/07, wolfmanjm <wolfmanjm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I use this in my controller... > > cookies[:_my_host_tz]= { :value => "PST", :expires => > 30.days.from_now, :path => "/" } > > and checking in Firefox, it does create a separate cookie from the > sessions cookie. > there is a _my_host_session_id and a _my_host_tz cookie. > > On Jul 3, 2:48 pm, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hi, > > > > How can I create a 2nd/separate cookie for my app (i.e. and not use the > > session tracking cookie). Is this possible? > > > > Currently the timezone id I''m saving via "cookies[:tz]" gets stored ok > in > > the application cookie (along with session_id etc), however the session > > cookie disappears after the browser is closed - and I don''t want to keep > > this session cookie "alive" longer than this. > > > > Tks > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
wolfmanjm
2007-Jul-04 00:39 UTC
Re: how can I create a 2nd/separate cookie for my app?? (i.e. and not use the session tracking cookie)
Sorry I''m not actually using the cookie to store TZ info, I''m actually using it to store last view time, but the technique for cookie storing should be the same :) On Jul 3, 4:14 pm, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> PS. How are you accessing the timezone info in your app out of curiosity? > > I''ve doing the following. Any comments welcomed? > * I''m not accessing via the cookie as if it''s not set and I set it in a > before filter it remains unset until the next browser request, so what I''m > doing is: > * Application code accesses value from session, with cookie value being used > when browser closed/opened. > * When even setting timezone in app set both cookie & session. > * BeforeFilter = Ensure that both session and cookie contains value. If > cookie is nil then set it with with session value and vica versa. If both > are nil then set a default in both cookie and session > > On 7/4/07, wolfmanjm <wolfma...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I use this in my controller... > > > cookies[:_my_host_tz]= { :value => "PST", :expires => > > 30.days.from_now, :path => "/" } > > > and checking in Firefox, it does create a separate cookie from the > > sessions cookie. > > there is a _my_host_session_id and a _my_host_tz cookie. > > > On Jul 3, 2:48 pm, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Hi, > > > > How can I create a 2nd/separate cookie for my app (i.e. and not use the > > > session tracking cookie). Is this possible? > > > > Currently the timezone id I''m saving via "cookies[:tz]" gets stored ok > > in > > > the application cookie (along with session_id etc), however the session > > > cookie disappears after the browser is closed - and I don''t want to keep > > > this session cookie "alive" longer than this. > > > > Tks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---