在Play应用程序中收到请求时,我可以像这样打印cookie:
println(request.cookies)
结果是这样的:
Map(PLAY_SESSION -> Cookie(PLAY_SESSION,bd5712f8fb6a7a43935e20f98d6b147181dda9d5-inr=val1&uid=val2,None,/,None,false,true))
我只需要键bd5712f8fb6a7a43935e20f98d6b147181dda9d5
,有没有办法在Play中获取它,或者我必须解析字符串?
答案 0 :(得分:1)
你可以得到像这样的cookie值:
' Deletes the old table and relinks it
' to the new schema
Sub DeleteRelinkToViewAndRename(loginInfo As AuthInfoz, tblName, tblTarget)
Dim objAccess As Access.application
Dim db As DAO.database
Dim tdf As DAO.TableDef
' Open the thing manually first...
'Shell """C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE""" & " " & loginInfo.dbs
Set objAccess = GetObject(loginInfo.dbs).application
Set db = objAccess.CurrentDb
' Delete the Linked Table...THIS WORKS UNCOMMENT LATER...
objAccess.DoCmd.DeleteObject acTable, tblName
' Relink the old table to the new schema
Set tdf = db.CreateTableDef(tblName, 0, tblTarget, "ODBC;DSN=MEDSN;Database=MEDATABASE;Trusted_Connection=Yes")
' Add the new table def
db.TableDefs.Append tdf
End Sub
如果你只想获得钥匙
val cookieValue = request.cookies.get(KEY) match {
case Some(cookie) => cookie.value
case None => ""
}