Cookie and client

I have a application on the web, that are supposed to open a certain document or documents in Notes Client, depanding on what I select on the web. The problem is to get this information to the client. I open Notes via Notes://. I have tried setting environment variables, but that doesn´t work. Then, I figured out that setting cookies from the browser could be a solution. The problem is to get Notes client to open the correct cookie. If I set the cookie named “Fastighetsnr” from the browser, Notes Client cannot find it. Any ideas how to solve this? Thanks!

Subject: Cookie and client

I just did something like this, but I had to read a cookie from VB. I don’t know if there is a simpler way, but I wrote some VB to find the cookie (it’s just a text file), open it, and then parse the values I needed out of it. You could do the same thing with LotusScript – maybe in the postopen event of the datatbase you’re opening.

Subject: RE: Cookie and client

Thanks for your answer!Can you post some sample VB code? How do you make sure that you look in the correct cookie directory?

Subject: RE: Cookie and client

This is as much code as I can share, but it will get you closer. You can find the cookies folder by doing an Environ(“UserProfile”) and then adding a “\Cookies” to the end of it. Then it’s a matter of finding the cookie you want and opening it for reading.

’ Find the location of the UserProfile – Environ(“UserProfile”)

sProfilePath = Environ("UserProfile")

If sProfilePath <> "" Then

’ Add \Cookies to the end of the UserProfile path

    sTemp = sProfilePath & "\Cookies"

Subject: Cookie and client

This may be easier than getting the special folder and searching for the correct file. WinINet.dll has functions for getting and setting cookies for a given URL. It doesn’t allow for a specific cookie to be returned (the CookieName argument is not implemented,) but it does return a list of all cookies for the URL. You then have to parse the list of cookies (delimited by semi-colons,) but it saves the searching for a file.

Example return string: “cookie1=value1; cookie2=value”

Declare Function InternetGetCookie Lib “wininet.dll” _

Alias “InternetGetCookieA” _

(Byval lpszUrlName As String, _

Byval lpszCookieName As String, _

Byval lpszCookieData As String, _

lpdwSize As Long) As Boolean

Dim sCookieVal As String

Dim bRet As Boolean

sCookieVal = String(255,0)

bRet = InternetGetCookie(“http://dominoserver/path”, Null, sCookieVal,255)

If bRet Then Msgbox "Cookie data = " & sCookieVal Else Msgbox “Failed”