Java tutorial
//package com.java2s; //License from project: Apache License import android.app.Application; import android.content.Context; import android.content.SharedPreferences; public class Main { private static Application app; private static String mCookie; private final static String key = "Set-Cookie"; private static void setCookie(String str) { SharedPreferences sp = app.getSharedPreferences("_cookie", Context.MODE_PRIVATE); sp.edit().putString(key, str).commit(); mCookie = str; } }