Web Servers General Talk - Remembering user choices across a session.

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers General Talk > January 2004 > Remembering user choices across a session.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Remembering user choices across a session.
ironcito

2004-01-19, 6:32 am

Hello all,

This might be a newbie question, so be patient. Is there a way that
I can ask the user a question when he first enters the site (for
example, his location or whatever) and have the server remember his
choice(s) and deliver content accordingly for the rest of the session?
Sort of like a server-side cookie, if you will. It would accomplish
exactly the same as a cookie, but on the server side. It would then
expire after a certain period of inactivity from that user. Is it
possible?
Thanks in advance.

Diego
Jochen Daum

2004-01-19, 6:32 am

Hi DiegO!

On 22 Nov 2003 10:46:16 -0800, correo@ironcito.com (ironcito) wrote:
quote:

>Hello all,
>
> This might be a newbie question, so be patient. Is there a way that
>I can ask the user a question when he first enters the site (for
>example, his location or whatever) and have the server remember his
>choice(s) and deliver content accordingly for the rest of the session?
>Sort of like a server-side cookie, if you will. It would accomplish
>exactly the same as a cookie, but on the server side. It would then
>expire after a certain period of inactivity from that user. Is it
>possible?



Any kind of server-side language will do that for you. Common are PHP
and MS ASP, there is also PERL and ColdFusion among others. What kind
of server is it?

Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- php scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
ironcito

2004-01-19, 6:32 am

Jochen Daum wrote:
quote:

> Any kind of server-side language will do that for you. Common are PHP
> and MS ASP, there is also PERL and ColdFusion among others. What kind
> of server is it?



Hello, and thank you for your answer. The whole website is still on
the "drawing board", but I will be using ColdFusion for database
conectivity and dynamic pages. However, I want to do the trick without
using variables in the URI. I don't want ?location=US at the end of
every URI when the user selects US as his location. I want the server
to "remember" his selection internally. I suppose this would be done
at HTTP server level?
Marc-Olivier Meunier

2004-01-19, 6:32 am

In article <e7d712e6.0311231655.4d3adcbc@posting.google.com>, ironcito wrote:
quote:

> Jochen Daum wrote:
>
>
> Hello, and thank you for your answer. The whole website is still on
> the "drawing board", but I will be using ColdFusion for database
> conectivity and dynamic pages. However, I want to do the trick without
> using variables in the URI. I don't want ?location=US at the end of
> every URI when the user selects US as his location. I want the server
> to "remember" his selection internally. I suppose this would be done
> at HTTP server level?



PHP, ASP, JSP, Coldfusion... any of these (and surely others) deal with
sessions very well. If you start a session as soon as a client connects
you can put informations in that session and it will never appear in the
URI and will be transmitted.
If you don't want to use sessions, simply use POST instead of GET.
GET will use variable like you said : ?location=...
while POST send everything in the header and the variables can be accessed
the same way.

--
Marc-Olivier Meunier
<< C'est en faisant n'importe quoi qu'on devient n'importe qui.
Faites comme moi, buvez beaucoup de bière. >> Mickey Mouse

ironcito

2004-01-19, 6:32 am

Marc-Olivier wrote:
quote:

> PHP, ASP, JSP, Coldfusion... any of these (and surely others) deal with
> sessions very well. If you start a session as soon as a client connects
> you can put informations in that session and it will never appear in the
> URI and will be transmitted.
> If you don't want to use sessions, simply use POST instead of GET.
> GET will use variable like you said : ?location=...
> while POST send everything in the header and the variables can be accessed
> the same way.



But according to CF documentation, it sends a cookie to the client
in order to identify each session. If the client does not accept
cookies, it must send a session ID in the URI. Quote: "To use
ColdFusion client or session variables without using cookies, each
page must pass the CFID and CFToken values to any page that it calls
as part of the request URL."
I'm looking for a method that is totally transparent from the
client side. No cookies, no variables in the URI. Yet different
content will we delivered across a session according initial
selections made by the user. Is it possible? I believe using POST
would require me to treat every link in the website as a form
submission, right?
Marc-Olivier Meunier

2004-01-19, 6:32 am

In article <e7d712e6.0311240953.598d603d@posting.google.com>, ironcito wrote:
quote:

> Marc-Olivier wrote:
>
> I believe using POST
> would require me to treat every link in the website as a form
> submission, right?



right :/

Do you have a problem with big URL displayed in the address box ?
Because if that is the only problem you can simply use a frame
and will ever see your ?location=somewhere
Or you could play a bit with Apache mod_rewrite which can (i guess, not sure)
take your big fat and ugly URL and write a nice one... (bad idea)

--
Marc-Olivier Meunier
<< C'est en faisant n'importe quoi qu'on devient n'importe qui.
Faites comme moi, buvez beaucoup de bière. >> Mickey Mouse

ironcito

2004-01-19, 6:32 am

Marc-Olivier Meunier wrote:
quote:

> Do you have a problem with big URL displayed in the address box ?
> Because if that is the only problem you can simply use a frame
> and will ever see your ?location=somewhere
> Or you could play a bit with Apache mod_rewrite which can (i guess, not sure)
> take your big fat and ugly URL and write a nice one... (bad idea)



I want to keep URIs as simple as possible, and in such way that if
I change technologies, the URIs will still be valid. I don't want
people to bookmark or link to
www.myweb.site/index.php?location=US&gender=M&age=31 or anything like
that.
I've found no way to remember variables without using cookies, URIs
or logins. I guess I will just have to use cookies and if someone
doesn't accept them, he will have to select the variables as many
times as needed.
Thank you for your comments anyway.

Diego
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com