You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by karthi <ra...@snovabits.net> on 2012/03/24 06:32:57 UTC

Tapestry5 services cookies not get writes in samsung galaxy nexus s

Hi,
 
   I am developing an application using tapestry (my first app), in that am
using cookies like below

public class Portfolio {

        @org.apache.tapestry5.ioc.annotations.Inject
	private Cookies cookies;

        cookies.writeCookieValue("isUserLogin", "True", 60*60);
	cookies.writeCookieValue("userId", userId, 60*60);

and read from cookie value by this method

        cookies.readCookieValue("userIdent");

I have tested this in firefox browser, Iphone OS 4, Android HTC, Android
Samsung galaxy s2 and in some other phones this cookie is working great in
all these phones, I can able to see my sysouts logs regarding cookeis etc.,

But in samsung galaxy nexus s (Android OS version 2.3.6) this cookies not
get write or saved...?

For testing purpose we wrote a single file to save this cookies, in that
also it dint write, however if I used javax.servlet.http.Cookie; the value
get writes in the phone!

What should have caused this problem?
Am I miss anything in code?
Can anyone help me to find the root cause here? 
    
}

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry5-services-cookies-not-get-writes-in-samsung-galaxy-nexus-s-tp5591264p5591264.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry5 services cookies not get writes in samsung galaxy nexus s

Posted by karthi <ra...@snovabits.net>.
Anyone help me to resolve this?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry5-services-cookies-not-get-writes-in-samsung-galaxy-nexus-s-tp5591264p5592747.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry5 services cookies not get writes in samsung galaxy nexus s

Posted by Kalle Korhonen <ka...@gmail.com>.
It's entirely browser dependent. Try using expires instead of max-age
(expires was used in some http 1.0 implementations before max-age took
over in http 1.1). You need to write the raw headers for it, see
http://mrcoles.com/blog/cookies-max-age-vs-expires/.

Kalle


On Mon, Mar 26, 2012 at 4:38 AM, karthi <ra...@snovabits.net> wrote:
> Thank you for your reply,
>
> In javax.servlet also can't able to set the max age, if I set so then in the
> samsung galaxy nexus s mobile the cookies does not get write or saved
>
> In tapestry services cookies also worked now in the same device by removing
> the max age parameter like below:
>
> cookies.writeCookieValue("isUserLogin", "True");
>
> But in the devices which I have tested so far - Iphone, HTC, Samsung s2,
> Sony ericson & some other android models this cookie with max age is working
> perfectly no issues in those devices, this issue is only in the nexus s
> mobile.
>
> Now how can I set the max age for the cookies?
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry5-services-cookies-not-get-writes-in-samsung-galaxy-nexus-s-tp5591264p5594974.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry5 services cookies not get writes in samsung galaxy nexus s

Posted by karthi <ra...@snovabits.net>.
Thank you for your reply, 

In javax.servlet also can't able to set the max age, if I set so then in the
samsung galaxy nexus s mobile the cookies does not get write or saved

In tapestry services cookies also worked now in the same device by removing
the max age parameter like below:

cookies.writeCookieValue("isUserLogin", "True");

But in the devices which I have tested so far - Iphone, HTC, Samsung s2,
Sony ericson & some other android models this cookie with max age is working
perfectly no issues in those devices, this issue is only in the nexus s
mobile. 

Now how can I set the max age for the cookies? 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry5-services-cookies-not-get-writes-in-samsung-galaxy-nexus-s-tp5591264p5594974.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry5 services cookies not get writes in samsung galaxy nexus s

Posted by Bob Harner <bo...@gmail.com>.
On Sat, Mar 24, 2012 at 1:32 AM, karthi <ra...@snovabits.net> wrote:
> Hi,
>
>   I am developing an application using tapestry (my first app), in that am
> using cookies like below
>
> public class Portfolio {
>
>        @org.apache.tapestry5.ioc.annotations.Inject
>        private Cookies cookies;
>
>        cookies.writeCookieValue("isUserLogin", "True", 60*60);
>        cookies.writeCookieValue("userId", userId, 60*60);
>
> and read from cookie value by this method
>
>        cookies.readCookieValue("userIdent");
>
> I have tested this in firefox browser, Iphone OS 4, Android HTC, Android
> Samsung galaxy s2 and in some other phones this cookie is working great in
> all these phones, I can able to see my sysouts logs regarding cookeis etc.,
>
> But in samsung galaxy nexus s (Android OS version 2.3.6) this cookies not
> get write or saved...?
>
> For testing purpose we wrote a single file to save this cookies, in that
> also it dint write, however if I used javax.servlet.http.Cookie; the value
> get writes in the phone!
>
> What should have caused this problem?
> Am I miss anything in code?
> Can anyone help me to find the root cause here?
>
> }
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry5-services-cookies-not-get-writes-in-samsung-galaxy-nexus-s-tp5591264p5591264.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>

I guess your're really doing:

    cookies.readCookieValue("userId");

(You corrected your Nabble post, but mailing list users don't see such updates.)

The Tapestry 5 Cookies API
(http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Cookies.html)
is only a very simple façade in front of javax.servlet.http.Cookie,
and is missing some basic functionality (can't specify the secure flag
per TAP5-47, can't set a cookie having a domain+path+max-age
combination per TAP5-1394/TAP5-1858, no ability to delete a session
cookie having a domain).

Can you provide the exact method in javax.servlet.http.Cookie (and its
parameters) that works for you? I'm guessing it's a variation that
doesn't have an exact match in the Tapestry Cookies API. In that case,
you might have to use the javax.servlet.http.Cookie class directly or
maybe provide a custom implementation of
org.apache.tapestry5.services.Cookies

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org