Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8868049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:10:32+00:00 2026-06-14T17:10:32+00:00

Environment Eclipse Juno Service Release 1 GWT 2.5 Google Chrome with the GWT developer

  • 0

Environment

  • Eclipse Juno Service Release 1
  • GWT 2.5
  • Google Chrome with the GWT developer plugin
  • Running GWT on the Jetty server using ‘run application’ as Google web application

I am trying to set 2 cookies using gwt using the following code:

if(result.getStatus() == ServerResponse.SUCCESS) {
    System.out.println("I will now set cookies: " + result.getMessage() + " and " + Integer.toString(result.getValue().getId()));
    Cookies.setCookie("opsession", result.getMessage(), new Date(System.currentTimeMillis() + ClientUser.SESSION_EXPIRY_TIME_IN_MINUTES));
    Cookies.setCookie("opuser", Integer.toString(result.getValue().getId()), new Date(System.currentTimeMillis() + ClientUser.SESSION_EXPIRY_TIME_IN_MINUTES));
    System.out.println("Cookie set: session: " + Cookies.getCookie("opsession"));
    main.checkLoginAndRedirect();
    System.out.println("Redirected.");
} else if(result.getStatus() == ServerResponse.FAILURE){
    new MessageBox(result.getShortTitle(), result.getMessage()).show();
}

It doesn’t seem to work. The println’s are there for debugging, and here is the output:

I will now set cookies: 1er1qmaly9ker and 1
Cookie set: session: null
nullnull
Redirected.

ClientUser.SESSION_EXPIRY_TIME_IN_MINUTES is (was an int) a long that returns 20.

Update

Using

if(Cookies.getCookie("opsession") == null) {
    System.out.println("opsession: cookie not found at all.");
}

I’ve confirmed that the cookie is not placed at all, and does not have a ‘null’ String value.

I’ve also changed
ClientUser.SESSION_EXPIRY_TIME_IN_MINUTES into a long.

Update

Fiddler confirms that cookie data has been sent:

Response sent 30 bytes of Cookie data: Set-Cookie: JSESSIONID=4kr11hs48gvq;Path=/

But only if I use the longer version of setCookie:

Cookies.setCookie("opuser", Integer.toString(result.getValue().getId()), new Date(System.currentTimeMillis() + ClientUser.SESSION_EXPIRY_TIME_IN_MINUTES), null, "/", false);

If I use the String, String, long variant, fiddler notices no cookie data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:10:33+00:00Added an answer on June 14, 2026 at 5:10 pm

    Should be

    new Date(System.currentTimeMillis()
    + (ClientUser.SESSION_EXPIRY_TIME_IN_MINUTES * 60000)))
    

    to convert the expiry time to milliseconds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it
I am using Google's Workspace Mechanic to configure my eclipse environment. All seems to
Environment Ubuntu 12.04 LTS Eclipse Juno 4.2 Build id: 20120614-1722 GWT SDK - 2.4.0
I have installed Plugin Development Environment on my Eclipse 3.8 via http://download.eclipse.org/releases/juno update site.
I'm coding a Rails project in a Windows environment and using Eclipse (with the
I am using eclipse as a development environment. I have several applications that link
Goal I am building an Eclipse plugin targeting the 3.7 environment and would like
We will be using eclipse(Helios or Indigo) for multiuser environment for development. For this
I've read the help of eclipse in blackberry development environment about the auto run
When I try to add Tomcat as a server runtime environment in eclipse, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.