Code example for Cookie

Methods: getExpiryDate

0
			redditSessionCookie= RedditTVPreferences.getStoredRedditSessionCookie(context);	
			loggedInUser=getPersistedLoggedInUser(context);
		} 
		 
		if(redditSessionCookie!=null){
			if (redditSessionCookie.getExpiryDate()!= null && redditSessionCookie.getExpiryDate().after(new Date()) ){
				Log.i("RedditTV", "Session cookie has expired. Deleting it");
				redditSessionCookie=null;
			}	 
		} 
		return redditSessionCookie;
	} 
 
	public ArrayList<RedditPost> getRedditPosts(Context context,String subreddit,String category, String period){
		 
		//after is a reddit paging mechanism 
		String afterId= generateKeyForAfter(subreddit,category,period);
		String afterValue=null;
		if(afterBySubReddit.containsKey(afterId)){
			afterValue = afterBySubReddit.get(afterId);
		}