Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing cookies and reading in the same script

Posted on 1998-09-21
6
Medium Priority
?
150 Views
Last Modified: 2013-12-25
I set the cookie without any problems. Even MSIE reports "accepting a cookie". The problem is that the cookie doesn't take effect immediately, but it starts "working" at the second page I go.
i.e I have a script (Perl) for logging into something like a chatroom. When registering for chat, users define what kind of chat will they use (science, romance, etc...). When someone logs in, I send a cookie to recognize his interests on my further pages and to customize colors, graphics etc. But the problem is that on the very first page after log in, the cookie is "not activated" yet. Is there any solution or what am I doing wrong.
0
Comment
Question by:topalzzz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:zhongbing
ID: 1828756
hi.
yse, it's possible, and there have been some questions of the same kind. so i don't paste the code here, u can check them.:
http://www.experts-exchange.com/topics/comp/lang/perl/Q.10082309
http://www.experts-exchange.com/topics/comp/www/cgi/Q.10075470

if u need more explaination or complete code, feel free to comment again.
0
 

Author Comment

by:topalzzz
ID: 1828757
Ok, perhaps I didn't define the question clearly.

I set the cookie without any problems. Even MSIE reports "accepting a cookie". The problem is that the cookie doesn't take effect immediately, but it starts "working" at the second page I go.
i.e I have a script (Perl) for logging in something like a chatroom. When registering for chat, users define what kind of chat will they use (science, romance, etc...). When someone logs in, I send a cookie to recognize his interests on my further pages and to customize colors, graphics etc. But the problem is that on the very first page after log in, the cookie is "not activated" yet. Is there any solution or what am I doing wrong.

I'll edit my first quiestion too.
0
 

Author Comment

by:topalzzz
ID: 1828758
Edited text of question
0
CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

 

Author Comment

by:topalzzz
ID: 1828759
Adjusted points to 150
0
 
LVL 7

Accepted Solution

by:
faster earned 300 total points
ID: 1828760
You should have two cases, the first is when a cookie exists, (i.e. >= 2nd request), for this case you get the information you want from the cookie.  The 2nd case is no cookie found, when that happens, you need to do two things: one is to set the cookie as yo do now, the 2nd is to use this data directly.


0
 
LVL 7

Expert Comment

by:faster
ID: 1828761
For example, if you store the user preference in a database, then when a cookie is not found, you should use the information in the databases directly.
0

Featured Post

URL rewriting in AWS CloudFront

A quick how-to guide to implement with a Lambda function!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question