?
Solved

WEB: Variable needed which is used for the session

Posted on 2003-03-26
17
Medium Priority
?
156 Views
Last Modified: 2013-12-18
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?
0
Comment
Question by:hreinart
[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
  • 7
  • 5
  • 4
  • +1
17 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 8220638
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
0
 
LVL 13

Expert Comment

by:CRAK
ID: 8220698
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....
0
 

Author Comment

by:hreinart
ID: 8223107
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
   
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 8225969
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] )
0
 

Author Comment

by:hreinart
ID: 8226270
i don't have a profile document.
how can i dreate one?
0
 

Author Comment

by:hreinart
ID: 8226343
..also will this work for a lot of different customers?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 8228040
@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.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8236753
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.
0
 

Author Comment

by:hreinart
ID: 8237405
this is a problem.
on the server where this application runs i only have my own account.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 8239212
Then how would you know who has requested for which data and how will you server him/her ?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8321174
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?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8321182
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.
0
 

Author Comment

by:hreinart
ID: 8324678
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.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8330002
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.
0
 

Author Comment

by:hreinart
ID: 8331661
ok, how to do?
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 150 total points
ID: 8505656
Sorry this took so long, dropped some mail.

Create a form that asks user for CustomerNumber.  I'll assume the field name is CustomerNumber.  The HTML Headers formula for the form should contain:

"<META HTTP-EQUIV=\"Set-cookie\" CONTENT=\"CustomerNumber=" + @Text(CustomerNumber) + ";path=/;expires=Saturday, 031-Dec-05 12:00:00 GMT;\">"

There should be a link on the form, something like /database.nsf/customerView

Where customerView is a form.  The customerView form should have the following:

Field named HTTP_COOKIE
Field, computed for display, called CustomerNumber.  The formula is @Trim(@Right(HTTP_COOKIE; "CustomerNumber="))
Embedded view for the customer info, catgeorized on customer number
The embedded view object should have a show-single-category formula of CustomerNumber

That should do it!
0
 

Author Comment

by:hreinart
ID: 10813706
please delete and refund points
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

764 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