Link to home
Start Free TrialLog in
Avatar of hreinart
hreinart

asked on

WEB: Variable needed which is used for the session

hi,

i'd like a web visitor to enter his customernumber (filed customernumber) when entering the web site.
this number should be available during the whole session.

e.g. if he buys something his customer number should appear automatically.

question:
what do i need to do to make this possible?
which code needs to be written for the filed/saving this information and which code to use it e.g. for a purchase?
Avatar of HemanthaKumar
HemanthaKumar

If you are using a customer name and login in your database, then you can use profile document to store that information OR

Cookies (using Javascript)

~Hemanth
Avatar of CRAK
You could try keeping that var in every URL, but that could require lots of effort to rewrite links in lots of views.
You could drop in in a top.variablename when you use a frameset. It's easy to set from within notes, it works fine, but you'll have a hard time to retrieve it in some occasions!
Most websites use cookies....
And you could setup a system where people request/create an id / password and have to login into your database (anonymous = no access).... When you know who they are, you know everything about them. And you could store that info in a cookie for their next login....
Avatar of hreinart

ASKER

oh, looks like it's a bit more complicate than expected.

cookies are not allowed as far as i know.

my idea was something like this:

1) enter the customer number

2) code: variable1 = customer number

3) view of all sold products for the customer:
   view with condition: customernumber=variable1

4) buy a new product (same session) :
   customernumber=variable1


... but i'm not the programmer
   
Then make use of Profile document. The Key will be CustomerNumber. IN the following formula Username will be your customernumber.

@GetProfileField(profilename ; fieldname [ ; username] )
&
@SetProfileField(profilename ; fieldname ; value  [ ; username] )
i don't have a profile document.
how can i dreate one?
..also will this work for a lot of different customers?
@Setprofilefield will create the field value and associated profile with the key as reference. You don't need any special function to create a profile (Ofcourse Editprofile command will create a new or reopens existing profile)

For eg, when user enters custNum, @Setprofilefield in a agent like this will set the profile and field

eg: @SetProfileField("Profile" ; "CustNum" ; "Cust0001"; "UserName")

Then you retrieve the custnum value like this
@GetProfileField("Profile" ; "CustNum" ; "UserName")

Hope it is clear.

PS: UserName, is the key which is important to retrieve values. So derive some unique mechanism to track the values.
Have the customers log on using their customer IDs and a password.  @UserName will then always return the customer ID.  You will need some way to pre-load the IDs into a web user directory, and assign passwords.

The rest of what you describe is straightforward Notes programming.
this is a problem.
on the server where this application runs i only have my own account.
Then how would you know who has requested for which data and how will you server him/her ?
hreinart,

Did you solve your problem?

As far as I can see, you need SOME way of tracking user identity.  That will require using either cookies or using authentication.  Using your own cookie would be insecure and difficult.  Using authentication is simpler and better; it mightalso use an automatic cookie, depending on the server setup.  HOwever, authnetication requires that each user have a person document, i.e., individual login.  You'll need to plan this out with your adminisrator and programmer.  It really isn;t a big deal -- you'll just want a web user login database configured via the Directory Assistance feature.

If you aren;t a Notes person, that may sound daunting.  But your Notes staff will understand it in a cinch.  Whether they will buy into it or not is another question -- but I don;t think you have much choice.

DOes that help?
ONe additional clarification:

Some web application servers allow you to do what you are describing by embedding a session ID in every URL generated by the server.  But they still require some form of authentication.  In this case, we can't do it via the URL, since DOmino doesn;t support it (thorugh you can have a really god programmer spend a lot of time getting it to work that way anyway).  But you would still need some authentication mechanism, which either has to be buuilt-in Domino mechanisms, or home grown.  ANd home grown will be less secure and much harder to build.
yes, it's still open.

i think you're going too far.

i only want that somethingis entered in a filed should be available during the session.

it's not so complicated as you might think.
Then use a cookie.  It is a standard practice, not just for Domino, but for almost every website in the world that supports personalization.  Definitely not secure though.
ok, how to do?
ASKER CERTIFIED SOLUTION
Avatar of qwaletee
qwaletee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
please delete and refund points